Javascript Charting scaling multiple series - javascript

I need to display a javascript chart with up to 8 series that vary wildly in values. Some of the series will display 0-1 values, and the rest of them could be anywhere from 0-1000000.
How can I display this data simultaneously on a Javascript chart? The problem I run into with jqPlot (what I'm used to) is it will display all the series but it's impossible to tell the values that go from 0-1 apart from each other and whether they are 0 or 1 at that moment in time.
X axis will always be a datetime range.
I'm used to jqPlot but couldn't figure out a way to do it. I'm open to other javascript solutions.

Related

Properly scaling xAxis with time in chart.js

Using chart.js, I have a bar chart with datapoints spread across many years:
If you look closely near the x-axis, you can see some grey bars. Here's a line chart with the same data for reference:
While using a line chart for this example could make sense, it makes the charts with less data a bit awkward:
and with bars instead of lines
Is there an option that could be used on bar charts to improve the readability when large x-axis are involved? I am representing occurrences of events over-time, another adapted kind of chart could be acceptable too.
Thanks.
I am not sure there will be an option on chart.js.
One way to deal with it is to render line charts initially and then switch the type to 'bar' when zoomed into certain date ranges.
Depending on the type of data, you could also group up the data by summing (or averaging) the data by day (or week or month). Then pass it into the chart and the time series option should be able to display the x axis dates in a more sensible manner.
Otherwise you will have to look into more power charting libraries that can handle and manipulate bigger datasets like amCharts: https://www.amcharts.com/demos/stock-chart-candlesticks/
Or look into using D3 that is highly customisable, but a bit more complex to work with.

Javascript line graph with tics and difference bar

I'm trying to create a chart similar to the one on the link in JavaScript (going to have the chart in Design Studio). I need there to be a line chart with the current years data and tick marks under with last years data. Between the line chart and the tick I want a bar connecting the two.
I've tried several things but I can only get somewhat close. Due to a few outliers, I also need to keep all values above a certain value and below a certain value to stay in a certain range to avoid the plummets seen.
This graph was created in Excel.

Plot multiple irregular timeseries on same line chart dojo

I am looking to create a line chart which will plot an array of data which has a corresponding x value (date/time) and y value associated with it. The chart can have any number of series (different lines on the same graph). You can think of this as like how yahoo/google graph a particular stock and if you want to compare different companies stock prices on the same chart.
The problem I am facing is that the data I am given might not be given in regular intervals (e.g. series 1 might give an array of plots that occur every 15 mins, series2 might be 10 mins, etc). Also the data might not have the same start / end time (e.g. series 1 starts at 8:40 am, series 2 starts at 8:42 am). There can also be holes in the data where no data was gathered (want to display this as nothing in the chart)
I have thought about some potential ways to solve this problem
Put everything on a 1 minute interval (the smallest possible interval) and place null values for everything we do not have data for. I need to have null values because there are datatips on the graph when you hover over a point to tell you what the value is at that point. The problem with this is that this will cause the graph to become a point graph rather than a line graph and will look ugly. I can tell dojo to interpret the data between null values but I also want to have explicit null values (e.g. when the market is not open leave the space as nothing rather than connecting the lines)
Round the data to the closest interval. The problem with this is the data is no longer accurate for that particular moment which is a problem.
Don't allow them to be plotted together (not an option).
Use a different charting library (last resort)
I am using the dojox charting library and I cannot change the back end code that gives me the data.
What are my options?

Highstocks fixed x-axis with ordinal true

I am using Highstock.js to build a stock ticker that spans three days. I am using a line to graph the S & P 500 vs time, and I have a data point for every minute the market is open. I also have a feed sending a new data point every minute. When the page loads the previous two days of data is loaded into the chart, plus all the data available so far today. Then I update with new data each minute.
All data is displayed correctly, but I am trying to split the x-axis into thirds (with no gaps). Each third would correspond to each day. This means the last third would only be partially filled while the current day's data is coming in. The line graph would be moving toward the edge of the chart.
The issue I am running into is that the line always fills the entire chart.
I have tried setting the xAxis.max, but this doesn't work unless I set xAxis.ordinal = false. but that leaves gaps for nights, weekends, holidays, etc...
I have also tried sorting and ignoring the x value, but it has become a headache to account for weekends and holidays. Plus I don't know how to get the axis labels back to the correct time.
Basically I'm asking, Is it possible to create a chart that is only partially filled, without ordinal = false

Adjusting distance between points in RGraph (javascript)

I'm using RGraph's Line charts to plot some chronological data. It works fine, except that the distance between the successive points is always the same - irrespective of whether they are two hours or two months apart. I would like to customize it so that the distance represents the actual time interval between the points. Is this possible using the Line charts or any other charts in RGraph?
I contacted RGraph support with the above question, and they have suggested that I use Scatter charts instead:
You'd be better placed with Scatter chart. With this chart you can set
the maximum X value and the X axis is scaled (which you can show if
you wish).

Categories