WinForms chart zooming X-axis labels temporarily disappear when zooming - winforms

I have a chart which looks like this:
When I zoom into a section, the labels disappear:
However, I can get the labels back by scrolling all the way to the right and releasing the mouse:
And then when I scroll back to the left, the labels are all visible:
This behaviour is just super weird am I'm completely dumbfounded as to what would cause this, or even how to debug.
Does anyone have any ideas on what I could try to fix this? I'd like the labels to be shown as in the last image, but when first zooming.

It looks like others have had similar issues, so I'm going to try combining several answers I found online to maybe help fix your issue.
John (DevExpress Support) says:
It appears that the AutoLayout feature leads to this issue. Please set the ChartControl.AutoLayout property to False. This should make axis label elements visible.
https://www.devexpress.com/Support/Center/Question/Details/T328948/x-axis-labels-disappear-in-chartcontrol
Valdemar (DevExpress Support) says:
I suggest that you use the Axis2D.ResolveOverlappingOptions properties. Set AllowHide to False:
[XAML]
<dxc:XYDiagram2D.AxisX>
<dxc:AxisX2D >
<dxc:AxisX2D.Label>
<dxc:AxisLabel>
<dxc:Axis2D.ResolveOverlappingOptions>
<dxc:AxisLabelResolveOverlappingOptions AllowRotate="True" AllowStagger="True" AllowHide="False" />
</dxc:Axis2D.ResolveOverlappingOptions>
</dxc:AxisLabel>
</dxc:AxisX2D.Label>
</dxc:AxisX2D>
</dxc:XYDiagram2D.AxisX>
https://www.devexpress.com/Support/Center/Question/Details/Q489042/chart-axis-labels-disappearing-when-chart-is-resized
SharpStatistics says:
The only way I could replicate the problem you describe is by setting the x axis Label.style interval to a specific value, say,
area1.AxisX.LabelStyle.Interval = 100;
and then when I zoom in on the chart if the zoomed x axis section is less than 100 I don't see any lables.
loi-se (the OP) replies:
Thanks for your suggestion! But as far as i know i don't set the xaxis labelstyle anywhere, i just use: Chartarea1.AxisX.IntervalAutoMode = IntervalAutoMode.VariableCount
This works fine in the case of the yaxis but the xaxis seems to behave on its own will. Maybe i should renew my .net framework installation and get the latest version of the chart component? Any other suggestions?
https://social.msdn.microsoft.com/Forums/vstudio/en-US/d345d4a3-a4be-4b41-9c83-9a9d9dbb69b9/the-labels-of-the-xaxis-are-disappearing-when-i-zoom-in?forum=MSWinWebChart
This one is for SSRS reports, but I'm assuming it uses the same (or similar library) and supports the link right above this one.
When designing an SSRS Report using Chart you may notice that some of the labels whether in X or Y axis are not being displayed, this is because it’s so smart that it detects what you actually want (not!).
To display all labels follow the steps below:
Right click either the X or Y axis, Click Properties:
Set the Interval to 1:
Viola!
https://randypaulo.com/2012/02/20/ssrs-chart-label-missing-xy-axis-missing/
That's about all I can find that are similar, without spending a bunch more time researching this. Hopefully something here helped!

Related

SciChart annotation that is on the axis and above with "normal" paning behavior

I have a situation in which I have a chart annotation that represents an event that happened. I want to add a marker that consists of several icons in the middle of it (see 1 and 2):
I tried the axismarkerannotation but it has a weird behavior of snapping its middle point and when it is paning out of range it disappears.
I saw there is the possibility to place an annotation on the ModifierSurface but couldn't find an example.
I will fiddle around with this approach but perhaps someone has an solution for this? I want both markers to be visible and not when the potin in between 1 and 2 is out of sight both dissapear...
Is treating both icons as seperate annotations the only viable solution?

Drawing a bar chart in the background of candlestick chart in apexchart

I am playing with candlestick graphs (example from here: https://apexcharts.com/javascript-chart-demos/candlestick-charts/basic/) everything work as expected.
However, I am struggling with adding my signal data for a visual representation of the graph.
I am unable to find a solution that works I was thinking I can somehow fine-tune a timeline - I tried chart.js/apexcharts and for now, I believe the closest will be with the second framework.
What I need is a bar chart that can be used in numeric ranges for the X and Y-axis as presented below. (the goal is to be able to add the green bar as presented)
Is there an easy win or an idea of how to approach this?
Is there something I am missing?
That is my current solution (line graphs with stopWin/stopLose and entry price).
Still suboptimal - but works and is easy to achieve.
After weeks of playing around with it - the solution stayed:
I got two instances of apexcharts one with candlestick and one with line graphs
they are in a single div with CSS playground and position absolute.
I am passing standardised min/max values and has to have the same amount of elements in them (line graphs are allowing You to add null values which allow using this solution.
The final version work is repeatable and looks good.
if you need some help in similar case - feel free to reach out ;)

SciChart changing the color map on a FastHeatMapRenderableSeries

I'm a long-time user of SciChart, but it's an old version (3.1). I've just started using FastHeatMapRenderableSeries for the first time, and there is a requirement for a user to alter the chart's gradient stops. I've implemented a UI to do this (see image), which involves dragging markers that updates their respective gradient stop within the ColorMap's LinearGradientBrush. It's working in as much as gradient changes can be seen in the chart's HeatColorMap (not shown on this screenshot), and also in my "drag" control (a Rectangle whose Fill is bound to the ColorMap's brush).
The problem is that the colours within the chart itself don't change - perhaps I was being a little too hopeful that this would happen automatically! Is this possible, or will I have to recreate the series each time there has been a change to the gradient?
We actually have this working in a later version of SciChart. Im not sure which version exactly but it was introduced at some point. Have a look at this forum post which discusses a bug in the heatmap color map binding in v5.
In the v6 examples suite, you can drag the heat map legend and recolour the chart automatically, so we know in principle this works.
Very cool image by the way!

WPF SciCharts Stacked Column Side by Side Spacing

I've noticed a weird issue with SciCharts on WPF and am trying to understand if the issue is something within our control or not.
I'm noticing, in particular, that the spacing between Stacked Column Series groupings is weird. If you load up the SciCharts v.4.x Example and look at the "Stacked Column Side By Side" example, you can see this. Simply go from having everything checked to unchecking "China." Every single other bar (despite that China is no longer selected, freeing up more margin around the groups) is now narrower, even though there is more space to occupy.
In my own usage, I have noticed that the spacing gets VERY unusual, despite the fact that nothing can be turned on/off. There are data points for everything and there is still a large gap, despite setting Spacing to Relative and 0.01 and the DataPointWidth to 1.0.
I haven't checked the v.5.x examples yet, but I know that the issue is showing up with our usage of 5.2.1.x assemblies.
Is there any other way of expanding or overriding spacing between groups? It gets terribly sad when we are showing 9 groupings (18 bars; 2 data points for each group, so 9 categories or groupings) and we have more whitespace around the bar groupings than the width of the bars themselves.
Thank you!
First thing I would suggest is to update. The latest official release is SciChart WPF v5.4 and SciChart WPF v6 is in BETA now to be released soon.
We have fixed hundreds of bugs over the years and Stacked Column spacing has come up several times.
In the latest version, there are properties to control Stacked Column spacing. You will need to check
StackedColumnRenderableSeries.UseUniformWidth: where true forces all columns to have the same width
StackedColumnRenderableSeries.DataPointWidth: where 0.0 - 1.0 controls the gap width
Finally, Stacked Column series require that all DataSeries have the same number of points.

Display percentage on piechart in WPF

Hii
Can anyone tell me how can I show percentage on the piechart....
The percentage is seen on mouseover event but I dont know how to show
the percentage on the piechart's slices....
If you are looking to put labels on the chart itself (instead of tooltip), take a look at this great blog post by WPF guru Bea Stollnitz.
It shows how to do this, in many different modes, and explains not only how, but why.
Take a look at amCharts Bundle for WPF. Pie chart supports labels on the slices, outside connected labels and includes an algorithm to prevent label overlapping.
I've just followed this tutorial (just to make sure) and I get the percentages of each slice as tooltip on mouse over by default.
If you post your code we might be able to spot if there's a problem with it.
You can use labelFunction in mx:PieSeries, and lableFunction look like that
private function pieSeries_labelFunc(item:Object, field:String, index:Number, percentValue:Number):String
{
return StringUtil.substitute("{0} ({1}%)",item.description,percentValue.toFixed(1));
}
Where description is the label that you want to see.
feel free to ask any question.

Resources