A question about filling missing data points in AnyChart stock chart.
How do you fill missing time period values in the stock chart with a horizontal line from last closing price? (A pretty standard way to display that rather than an empty space)
I figured out forced grouping plus chart.xScale('scatter') allows a linear scale when data points aren't linear.
Here is an example chart: https://playground.anychart.com/DZuFyB69
Related
I'm using highcharts-react-official for a histogram with typescript. The problem I'm facing is, when user zooms in the values on the extreme of x-axis disappear (highlighted relevant x-axis values).
highchart
The zoom configurations that I'm using in Highcharts are something like this:
zoom on x-axis only
I did go through Highcharts documentation and some articles as well, but couldn't find any solution. If you have any previous experience in Highcharts then I'm sure you would be able to assist me here.
You are looking for cropThreshold property. From Highcharts API:
cropThreshold: number
When the series contains less points than the crop threshold, all
points are drawn, event if the points fall outside the visible plot
area at the current zoom. The advantage of drawing all points
(including markers and columns), is that animation is performed on
updates. On the other hand, when the series contains more points than
the crop threshold, the series data is cropped to only contain points
that fall within the plot area. The advantage of cropping away
invisible points is to increase performance on large series.
Defaults to 50.
You can increase the value:
plotOptions: {
series: {
cropThreshold: 9e9
}
}
Live demo: https://jsfiddle.net/BlackLabel/w6y4zdk8/
API Reference: https://api.highcharts.com/highcharts/series.column.cropThreshold
I am using Data-Studio to generate charts. I am generating charts for compute instances based on their CPU usage,in time-series. When I generate a chart(a line chart) a few instances are represented as lines in the chart, which have specific CPU usage values, but the majority of instances get accumulated into a category called "others" and therefore I am unable to show the metrics for others and the chart is not very useful.
Is there any way this category others can be avoided in data studio? so that all the instances are represented by a line or a bar?
I am new to Data-Studio. Kindly help. Thanks
There are a couple of ways to display the chart Without the Others series:
1) Time Series Chart
If you are using Date in the X-Axis (Dimension) then I'd suggest a Time Series chart as it's designed for Dates, and automatically sorts by Date as well as allowing for Date Range comparison (it also don't display the Others series, and series can be displayed as a line or bar).
2) Line Chart
Regarding the initial question (Line Chart) - Tested this out in a number of different Reports and Data Sources to confirm, and it seems to do the trick:
Create a Time Series chart;
Change the Chart Type to a Line chart;
Sort by Date in Ascending order.
Google Data Studio Report and a GIF to elaborate:
To see the problem, try accessing the last data point on the multi-series stock demo with a mobile device. My hit rate is less than 50% on the last point on a series (finger hovering)
I tried setting margin-right and spacing-right but no help. The problem is that the last data point is on the edge of the plotting area so it is harder to access with finger. Is it possible to add some padding on the x-axis so that it is easier to hover the last data point?
Thanks!
You can use minPadding / maxPadding parameters http://api.highcharts.com/highcharts#xAxis.minPadding / http://api.highcharts.com/highcharts#xAxis.maxPadding
I have a silverlight chart with an Area Series.
my data source returns many points representing time of day to be displayed in the chart's X-axis.
since the X-axis has many values, the values appear scrambled as each value is stuck beside the next value.
is there a method to avoid displaying all the values in the X-axis and display intervals instead ?
thanks
The DateTimeAxis has Interval and IntervalType properties that allow you to set the interval the you prefer.
I'm using the newest chart control from silverlight toolkit to plot some data. For small cases it works ok, but for bigger samples the X axis labels overlap. It would be no problem if the chart would simply omit some of the values or I could specify to just show every 10th of them ...
I couldn't find any properties providing this behavior. Any ideas?
Assuming this is a Linear axis then you can specify the interval to use via the the Interval property on the axis.
If the axis in question is Category Axis then dropping some labels may not be valuable to the user. One option is to use the LayoutTransfomer to rotate the labels to an angle reducing the width needed for each one. See this Delay Blog on the subject.