Plotting a SciChart series with a TimeSpan X-Axis when the plotted TimeSpan value is greater than 24 hours - wpf

I have a SciChart surface that is bound to an ObservableCollection<IRenderableSeriesViewModel> named TrendSeries. My DataSeries type is XyDataSeries<TimeSpan, double>.
My X-Axis is showing correctly when my timespan range is less than 24 hours. When I plot points that have a TimeSpan value of greater than 24 hours, the X-Axis (Time) incorrectly shows a range of 00:00:00 to 00:00:00.
How can I get my X-Axis to show correctly when I am plotting values with a TimeSpan greater than 24 hours?
<s:SciChartSurface RenderableSeries="{s:SeriesBinding TrendSeries}">
<!-- Define X Axis -->
<s:SciChartSurface.XAxis>
<s:TimeSpanAxis AxisTitle="Time"
AutoRange="Always" GrowBy="0.1, 0.1"
AxisAlignment="Bottom"/>
</s:SciChartSurface.XAxis>
<!-- Define Y Axis -->
<s:SciChartSurface.YAxis>
<s:NumericAxis AxisTitle="Value" AutoRange="Always" GrowBy="0.1, 0.1"/>
</s:SciChartSurface.YAxis>
</s:SciChartSurface>

this is a similar problem to this one: SciChart WPF Y-Axis and Data labels do hot have precision and show the same number
Essentially what you're seeing is the default TextFormatting on the TimeSpanAxis is set to "-hh:mm:ss"
Changing this to another .NET Formatting string, or dynamically changing it using the techniques presented in this answer will give you the desired behaviour

Related

Anychart 8 - Datetime value is getting rounded off in tooltip

I am facing this issue that when I hover on a point in anychart spline/colume graphs, then the crosshair label on x axis(datetime scale x axis) is showing me the rawvalue and i am able to format that to minutes format. But at same point, my tooltip is giving me x value with rounded off to hours only. Why its happening and how can we resolve it?
To avoid inaccurate date output, you could use text formatters, as shown below
var tooltip = chart.tooltip();
tooltip.title().text("Title");
chart.tooltip().format('{%x}{dateTimeFormat:d MMMM \'\'yy HH:mm}');
And in the sample here: https://playground.anychart.com/HPjfaiYh/2

Custom X-axis label formatting in Winform Chart Control

I am plotting graph with numeric value on Y axis and Date time value on X axis in windows forms chart control. I am setting X axis scale "IsLogarithmic" to true and i am getting the graph as shown in the image ...
I want to set the label formatting of X axis in such a way that it shows me 10^1, 10^2, 10^3 and so on...
Any idea or help will be appreciated.

JFreeChart: Logarithmic Axis Tick Labels missing

I am using JFreeChart to make XYLineCharts with a Logarithmic y-axis but am facing an issue that I am unable to resolve.
My x, y values are very low in some cases (in one such case, the y-axis values for the dataset range between 4.5e-8 to 1.7). I plot these values on a XYLineChart using a Logarithmic Axis for the y-axis (and using LogAxis.createLogTickUnits(Locale.ENGLISH) and .setExpTickLabelsFlag(true) on the y-axis to create the exponential tick units). I set my range's bounds from 4.5e-8 to 1.7 and can see the points plotted clearly but there are no tick labels visible for the y-axis !
I was earlier having this issue while zooming into the charts but I have fixed the zoom & AutoZoom by over-riding those methods.
My current LogarithmicAxis works well for most of my x, y datasets but in a few cases, the y-axis is plotted but does not show any Tick Labels on it, despite my creating them & setting their visibility to true.
If anyone has any suggestions on how to fix this & ensure that the Tick Labels are visible no matter what the y-axis values may be, please let me know soon as I need to get this done ASAP.
Thanks.

Silverlight Area Series chart: how to define interval for X-Axis

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.

Silverlight toolkit chart too many labels on axis

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.

Resources