kirsan31 / winforms-datavisualization

System.Windows.Forms.DataVisualization provides charting for WinForms applications.
MIT License
47 stars 19 forks source link

candleSticks don't work #58

Closed rowi123 closed 2 weeks ago

rowi123 commented 2 weeks ago

i use Points.AddXY (if it matters) i have a working project .net 4.8 and now i use this nuget i tried adding a series and some bars, but it draws very weird i have 0 issues with a line graph

expected expected this nuget this nuget

kirsan31 commented 2 weeks ago

I think this may be related to: IsXValueIndexed flag: https://github.com/kirsan31/winforms-datavisualization/blob/dev/Docs/BreakingChanges.md

If not, then we need a repro project to check.

rowi123 commented 2 weeks ago

wow, now that is a fast reply :) yes that was it!

to be clear if someone else it reading this, old:

chart.Series.Add( new Series( "candles" ) { ChartArea = "ChartArea", Legend = "Legend", ChartType = SeriesChartType.Candlestick, CustomProperties = "PriceDownColor=#ff0000, PriceUpColor=#4caf50", BorderWidth = 0 } );

new:

chart.Series.Add( new Series( "candles" ) { ChartArea = "ChartArea", Legend = "Legend", ChartType = SeriesChartType.Candlestick, CustomProperties = "PriceDownColor=#ff0000, PriceUpColor=#4caf50", BorderWidth = 0, IsXValueIndexed = true } );

Couldn't you set IsXValueIndexed = true as default?