Problems with Legend Box

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

Martin Schmidt
Posts: 6
Joined: Thu Aug 31, 2017 8:59 am

Problems with Legend Box

Post by Martin Schmidt » Thu Nov 16, 2017 8:53 am

Hello,

I have some problems with the legend box. Maybe you can help me with my issues ;) .

I have some data series and a legend box. The user should be able, to change the color of a series. So I open a color picker dialog when the user clicks on the series title in the legend box.
Because legendBox.HighlightSeriesOnTitle = true; the series is highlighted at this moment, that's what I want. So the user can see which series color will be changed. But when I close the color picker dialog, the series is still highlighted. I don't find a way to remove the highlighting other than moving the mouse over the legend box series title again. Even moving the mouse in the view and over the series does not remove the highlighting.
How can I remove the highlighting?
I tried series.SetHighlight() and series.RemoveHighlight(), but that caused other problems. For me it looks like something internally is missing while moving away from the legend box by opening the color picker dialog instead of leaving the legend box by mouse movement. But maybe I'm simply missing something.

Next thing is, the color of the series title in the legend box is not updated after I have changed it.
Is there something I can do to update the legend box, something like refresh?

Another thing, not so important because there is a simple workaround:
When I click with the right mouse button on a series title in the legend box:
legendBox.SeriesTitleMouseDown Event: MouseEventArguments.RightButton is MouseButtonState.Pressed; // That's what I expect
legendBox.SeriesTitleMouseClick Event: MouseEventArguments.RightButton is MouseButtonState.Released; // Shouldn't this be also MouseButtonState.Pressed?

Any help is highly appreciated, I tried to solve this issue for some time now in vain.
Thank's a lot and have a nice day.

Martin Schmidt
Posts: 6
Joined: Thu Aug 31, 2017 8:59 am

Re: Problems with Legend Box

Post by Martin Schmidt » Thu Nov 16, 2017 12:55 pm

Ok, I have solved my second issue.
Problem was, I only set LineStyle.Color, I must set Title.Color also. My fault.

But my first issue with the highlighted series still exists.

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

Re: Problems with Legend Box

Post by ArctionKestutis » Thu Nov 16, 2017 2:59 pm

Hello Martin,

Indeed it seems the problem with Highlighting then you open another windows-dialog on top of LightningChart. The temporal loss of focus prevent object (in this case Legendbox series title) from receiving HoverOff event. The Series.RemoveHighlight() call is not helpful here, because it is not intended to prevent the highlighting caused by mouse hovering. We will explorer a little bit, and let you know how this issue could be fixed.

As for MouseButtonState, it looks fine to me. To my knowledge, the mouse click event is generated then someone release mouse button, not on down event.

All the best.

Martin Schmidt
Posts: 6
Joined: Thu Aug 31, 2017 8:59 am

Re: Problems with Legend Box

Post by Martin Schmidt » Thu Nov 16, 2017 3:25 pm

Thank you for reproducing and analysing this issue.

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

Re: Problems with Legend Box

Post by ArctionKestutis » Fri Nov 17, 2017 9:42 am

Hello Martin,

The highlighting through LegendBox is special case and internally using special flag, which is not cleared other way than hovering-off Legendbox item. We will fix it in the feature releases of LightningChart.
As for know, you may want to open color-selection-dialog when clicking on series itself. Just in this case force highlight before opening Dialog and remove afterwards:

Code: Select all

            series.SetHighlight();
            colorDialog1.ShowDialog();
            series.RemoveHighlight();
Hope this helps.

Martin Schmidt
Posts: 6
Joined: Thu Aug 31, 2017 8:59 am

Re: Problems with Legend Box

Post by Martin Schmidt » Fri Nov 17, 2017 10:50 am

Thank you for your reply.

I think, I will do it this way but it's not so nice, because it is not unusual that we have multiple series that differ not that much. So this means, sometimes I must zoom in to hit the correct series. This would be more user friendly to handle in the legend box. But for now I can live with it.

Nevertheless it would be great if you can solve this issue in a future release.

Thanks a lot and have a nice day.

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

Re: Problems with Legend Box

Post by ArctionKestutis » Wed May 23, 2018 6:23 am

Hello Martin,

Issue has been fixed in version 8.2.1.4. Could you confirm the fix?

All the best.