I am using the annotated time line chart in google charts API. I have a long time line of data (20 years) and range of the data goes from about 0 to 900,000 (see picture) If you zoom on the most recent year, the max from this set is only about 400,000. So when we zoom in, I don't need the y-axis to go all the way to 900,000, but only to 400,000. This way the chart would be easier to read.
What I would like to achieve is the chart to re-adjust the maximum vertical axis value every time I adjust the zoom.
Zoom in on most recent year:
Before I start hacking my way through this, does anyone know a good way to do this?
Thanks!
Use the scaleType configuration option. Specify value of maximized if you have one series. Specify allmaximized if you have more than one series. This snippet works on the code playground:
var annotatedtimeline = new google.visualization.AnnotatedTimeLine(
document.getElementById('visualization'));
annotatedtimeline.draw(data, {'scaleType':'allmaximized'});
Related
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.
Is there any way to limit the number of x axis values that will be displayed given that there are many points to be displayed on the graph? Otherwise,the x-axis labels overlap if you don't zoom. For example, please see the fiddle I've created http://jsfiddle.net/ggggg/jx3q8uoy/10/
enter code here. You can zoom in and out with the mouse wheel. If you click on update I reload new data on the graph but since there are many points for the size of the graph the x-axis values get mixed with each other which is not good. One cannot make a difference which is which unless they zoom. Is there any way to limit the number of x-axis labels to be shown to just a few so that they don't get mixed in such a way when the point amount is big and if you zoom in then you will be able to see the specific x-axis labels? For example, please have a look at the vis.js graph here http://visjs.org/examples/graph2d/03_groups.html. See when you zoom in or zoom out with the mouse wheel the x-axis labels get rescaled and many of them get hidden and if you zoom in they are shown. I need something like for flot.js
Thanks
I am building an arc graph where the start and end points of the arcs are times in one day. I have a d3 scale that converts date objects into radians, but I need a scale with four ticks applied around the outside of the graph. I did it with jQuery, and you can see how it's supposed to look below
The problem I'm having is that the jQuery (and myself) is doing a poor job keeping those ticks at equal distances from the graph. Different screen sizes are making this a pain.
Does anyone have any idea how do create d3 time axis that is a circle? I've googled with no results.
Here is a link to the live site
Looking through the documentation for Highstocks, I found this example:
Shown here is two series on the same chart, therefore with a linked range selector - this is really really useful, but I wish to display something different which is proving to be very difficult.
What I'm looking for is a normal line graph on the top series, representing data plotted onto time (almost like in this example), but a bar chart or horizontal candle chart in the lower graph, representing one or more timelines.
I've drawn an image of what I'm looking for:
I apologise for the crude drawing, but hopefully it shows what I am aiming to achieve: standard graph on top, bar/candle on bottom.
I have attempted various techniques to render this, but I can't find a way to have both series drawn on the same timescale, linked with the same range selector.
In case it helps, here's a starting point on JSFiddle, with all the unnecessary code removed: http://jsfiddle.net/g105b/8JhXv/
and a link to the original demo: http://jsfiddle.net/gh/get/jquery/1.7.2/highslide-software/highcharts.com/tree/master/samples/stock/demo/candlestick-and-volume/
Answer taken from official Highcharts forum
it is possible, but with some limitations. In the fact you want to show gantt chart. Bar charts aren't possible in your case - bar chart = inverted whole chart (yAxis becames xAxis, etc). Instead take a look at example for gantt chart: http://jsfiddle.net/highcharts/r6emu/
You can combine them into one, ane effect: http://jsfiddle.net/8JhXv/1/
About limits:
tooltip fo bottom chart is availabe only when you mouseover start and end date
bars are on lines, not between them
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).