Some contour lines are not drawn

A forum dedicated to WinForms version of LightningChart Ultimate.

Moderator: Queue Moderators

Post Reply
jn3hms
Posts: 7
Joined: Mon Feb 27, 2023 8:14 am

Some contour lines are not drawn

Post by jn3hms » Mon Feb 27, 2023 8:30 am

I am using ViewXY's IntensityMeshSeries to draw a HeatMap and contours.
Contour lines are drawn at the maximum value of ValueRangePalette, but there are parts where lines are not drawn even at the same Step. :?
Are there any countermeasures?
contour.png
contour.png (31.33 KiB) Viewed 11643 times
thank you.

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Some contour lines are not drawn

Post by ArctionKestutis » Mon Feb 27, 2023 1:13 pm

Probably resolution of your IntensityMesh is low.
You could try to increase ContourLineStyle.Width, as default just 1 px.
You can read/get the list of contour lines with _intensityMesh.GetContourRoutes() method. Afterwards, you can use LiteFreeformLineSeries or FreeformPointLineSeries to draw those polylines as separate object/series.

Hope this helps.

jn3hms
Posts: 7
Joined: Mon Feb 27, 2023 8:14 am

Re: Some contour lines are not drawn

Post by jn3hms » Wed Mar 01, 2023 6:19 am

I was able to draw contour lines without any problem.
contour2.png
contour2.png (85.61 KiB) Viewed 11635 times
I tried changing the thickness of the line using the first method, but there was no change.
I was able to achieve it by redrawing using the second _intensityMesh.GetContourRoutes() and FreeformPointLineSeries.

However, with this method, the contour line information obtained by _intensityMesh.GetContourRoutes() will not be updated unless it is redrawn with EndUpdate(), so the contour line cannot be redrawn. :?

1st.

Code: Select all

BeginUpdate()
--- draw mesh ---
ContourLineType = ContourLineTypeXY.ColorLine;
EndUpdate()
2nd.

Code: Select all

BeginUpdate()
_intensityMesh.GetContourRoutes()
--- Redraw Contours ---
mesh.ContourLineType = ContourLineTypeXY.None;
EndUpdate()
Contour lines flicker because the chart has to be drawn in two steps.
Are there any countermeasures?

thank you.

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Some contour lines are not drawn

Post by ArctionKestutis » Wed Mar 01, 2023 12:16 pm

As far as I know, _intensitySeries.GetContourRoutes() itself does not require EndUpdate() call.
It just require that _intensitySeries.Data property is already set, as well as _intensitySeries.ValueRangePalette property.

Therefore, this means that you basically could include _intensitySeries creation and FreeformPointLineSeries creation in the same BeginUpdate-EndUpdate batch.

If you changing some _intensitySeries parameters (like palette or grid values), you should clear line-series and call GetContourRoutes() method again.

If something is not working as expected, maybe you should send/share your (test) project with us (you can also sent directly to Support(at)lightningchart.com email)

jn3hms
Posts: 7
Joined: Mon Feb 27, 2023 8:14 am

Re: Some contour lines are not drawn

Post by jn3hms » Thu Mar 02, 2023 5:22 am

I'm sorry. It seems that I was mistaken.
I checked and it seems to be drawn correctly.

When I zoom in on the chart, the color hierarchy and contour lines are out of alignment. Is it possible to fix this?
ContourLineType or FreeformPointLineSeries gives the same result.
contour3.png
contour3.png (28.97 KiB) Viewed 11630 times
thank you.

ArctionKestutis
Posts: 555
Joined: Mon Mar 14, 2016 9:22 am

Re: Some contour lines are not drawn

Post by ArctionKestutis » Thu Mar 02, 2023 8:53 am

Intensity-series Fill and Contour-Line calculations use slightly different algorithms. Therefore, they are not aligned pixel-by-pixel. I believe, that Contour-Line calculation are more precise, because algorithm divides grid-cell in more triangles.
One way to avoid it is increase resolution of Intensity-series data. That is, up-sample grid.

Another solution, which actually should have been mentioned in first place, is setting

Code: Select all

_heatmap.ContourLineType = ContourLineTypeXY.FastColorZones; 	// or  FastPalettedZones
'Fast' uses GPU based calculation, which suppose to be faster, but lack precision. Typically contour-line with this settings are very wide, but maybe this is that you need.

Post Reply