trying to plot three lines using Amchart, but lines are not drawn - amcharts

I am new to amchart. Trying to plot three lines in a graph where x-axis is time stamp with month-day hour:seconds format (HH-dd HH:s).
any kind of help will be appreciated.
setting time like this:
chart.dateFormatter.inputDateFormat = "MM-dd HH:S";
Here is the link to the jsfiddle
http://jsfiddle.net/azaman13/dymhbjk1/4/

Related

dimple - make line dotted for only part of the chart

Using dimple, how can I make the right-most data point in a line chart be connected to the previous data point by a dotted line, while the rest of the line chart still uses a solid line?
(Think a chart with a future projection at the end, or any situation where the final data point is "different" than the rest.)
I don't know dimple.js. The approach used in an Excel chart would be to plot a second data series and let the "connecting" data points overlap.
A similar approach should be possible with any tool that produces line charts.
I would suggest splitting your data to "real" data and "expectations"/"forecast" data, and create a series for each one.
The real data would contain all data points except for the right most one.
Forecast-data will contain only the two right most points.
For the real data draw the chart as usual and for the forecast data create a line chart with custom classes as shown here: Custom Classes
The line class should look like:
.dotted-line {
stroke-dasharray:"10,10";
}
and before drawing insert the custom class as the class for axisLine:
myChart.customClassList = {
axisLine: 'dotted-line'
}
More on customClasses can be found here
More on dotted lines can found here

Animating XY Line in TecPlot

I'm an environmental engineer using TecPlot to plot come charts with some input data, let me explain my problem.
I'm studying the evolution of a river bed with a Fortran code which I wrote. As a output the code gives a detailed stratigraphy going some centimeters under the soils surface. Basically the output file looks like this:
0.03500000000 -0.18093000000 -0.17093000000 -0.16093000000 -0.15093000000 ...
0.10500000000 -0.18100000000 -0.17100000000 -0.16100000000 -0.15100000000 ...
0.17500000000 -0.18107000000 -0.17107000000 -0.16107000000 -0.15107000000 ...
0.24500000000 ...
and so on.
The first column is the x variable (horizontal evolution) and has 200 data.
The other columns are the evolution on the vertical coordinate.
So basically for each line we have, starting from the second colon, an horizontal line drawn thanks to 400 values.
For example if I plot the entire first column with the entire first row what I get is just a line on the plot.
For each time step my Fortran code create an output file which gives a plot with all the substrate lines.
What I want to do, and I really don't know how to do it, is animating this plots in order to have, for each time step of the animation, the ENTIRE plot with ALL THE LINES.
What I've done in TecPlot so far is:
1) import all the output files
2) put them in the XY Line plot of TecPlot using one zone for each output file I have (file 1 -> 1:ZONE001, file 2 -> 2:ZONE001, file 3 -> 3:ZONE001 and so on)
3) trying to turn them into contour plot (no results)
3.2) trying to animate them with XY Line plot animation (too bad, it animates every single line...)
I hope that I've been enough thorough to let you helping me.
I would appreciate each contribution and I thank You for each -even short, small- answer.
Best regards
Assuming you have already loaded the file, and have multiple zones. you can animate the mappings by Animate -> Mappings.., As far as
trying to animate them with XY Line plot animation (too bad, it animates every single line...)
is concerned, you need Map Skip value more than 1, to skip the mappings (lines). The animation can be saved as video or image sequences from the same dialogue box, by pressing the small video button besides the play rewind and forward buttons enter image description here

Draw line chart using dc js

I wish to draw a simple line chart of my data, plot the sum of reviews against review dates. Examples I've seen so far are only plotting frequencies http://www.d3noob.org/2013/08/add-line-chart-in-dcjs.html i.e. number of occurrence of the days. Can someone please show me how I can do that or a link to an example?
var data = [{review_date:'2013-Feb-1', reviews:40},
{review_date:'2013-Feb-2', reviews:12},
{review_date:'2013-Feb-2', reviews:47},
{review_date:'2013-Feb-3', reviews:71},
{review_date:'2013-Feb-5', reviews:80},
review_date:'2013-Feb-5', reviews:13}]
Is your data sorted by date already? Then just create a new dataset and summarize your data there. You can find an example of a simple line chart here:
http://bl.ocks.org/mbostock/3883245

Plot time series and image in R so that x axis labels line up perfectly

I am trying to plot a time series (a seismograph) with a corresponding spectrogram in R.
Since I would like to compare the time series with the spectrogram, the X axis labels on the time series need to line up with the X axis labels on the spectrogram. However, I'm having a lot of trouble with this. The best I've been able to do so far is use
par(mar=c(0,10,0,8))
and try to manually force the spectrogram labels to line up with the time series labels by tweaking the spectrogram margin. Of course this is only approximate and they still do not line up perfectly. Is there a way to make the axes generated by the code below match up with each other?
par(mfcol=c(2,1))
plot(seq_len(1000)*0.01, sin(2*pi*seq_len(1000)*0.01), type="l",xlab="Time",
ylab="Amplitude", main="Time Series", xlim=c(1,10))
image(seq_len(1000)*0.01,seq_len(100)*0.1,array(runif(1000000),dim=c(1000,100)),
xlab="Time", ylab="Frequency", main="Spectrogram", xlim=c(1,10))
Thanks in advance!
This seems to work:
par(mfcol=c(2,1))
plot(seq_len(1000)*0.01, sin(2*pi*seq_len(1000)*0.01), type="l", xaxs="i")
image(seq_len(1000)*0.01,seq_len(100)*0.1,array(runif(1000000),dim=c(1000,100)),
xlab="Time", ylab="Frequency", main="Spectrogram")
Just drop the xlim= arguments and use xaxs="i" in the plot() function to match the default for image().
You can either add xaxs='i' to the call to plot (this removes the extra padding so it lines up with the image plot), or you could use par('usr') after the 1st plot to see what the x limits are and use those values in the xlim call in image.
It turns out that this is way easier than it looked initially. The secret is to make a "dummy plot" and then add the image to the plot. So here's how the new, working code looks:
par(mfcol=c(2,1))
plot(seq_len(1000)*0.01, sin(2*pi*seq_len(1000)*0.01),
type="l",xlab="Time",ylab="Amplitude", main="Time Series")
plot(c(0,10), c(0,10), type="n") #Dummy plot with axis limits for our spectrogram
image(seq_len(1000)*0.01,seq_len(100)*0.1,array(runif(1000000),dim=c(1000,100)),
xlab="Time", ylab="Frequency", main="Spectrogram",add=TRUE)
Similar, but conversely, to Greg Snow's answer, you could add xaxs='r' to the call to image as follows:
par(mar=c(0,10,0,8))
par(mfcol=c(2,1))
plot(seq_len(1000)*0.01, sin(2*pi*seq_len(1000)*0.01), type="l",xlab="Time",
ylab="Amplitude", main="Time Series", xlim=c(1,10))
image(seq_len(1000)*0.01,seq_len(100)*0.1,array(runif(1000000),dim=c(1000,100)),
xlab="Time", ylab="Frequency", main="Spectrogram", xlim=c(1,10), xaxs="r")
Don't forget to save your par() setting first.
(maybe I should have put that above)

SQL Server Reporting Services x-axis interval

I have a chart in SSRS that needs to have a flexible x-axis grid line interval (show at most 6 major grid lines), and I'm using the formula I've used dozens of times before:
=Floor(Count(Fields!Date.Value)/5)
However, for some strange reason, the chart only ends up showing the first value on the x-axis. The line gets plotted correctly, but there are no grid lines and no x-axis labels save the first one.
What's going on?
Well I found the answer. The data set I'm using has multiple fields, some of which are not being used by the chart. However, because the column I'm grouping on may have several repeat values, I had to change Count() to CountDistinct(). This resolved the issue.

Resources