How to change the background color and font color of the parallel coordinate chart

A forum dedicated to WPF version of LightningChart Ultimate.

Moderator: Arction_LasseP

kihoon_sung
Posts: 5
Joined: Fri Jul 02, 2021 8:01 am

How to change the background color and font color of the parallel coordinate chart

Post by kihoon_sung » Wed Jul 07, 2021 4:37 am

_chart = new LightningChart();
_chart.Margin = new Thickness(0, 30, 0, 0);
_chart.ColorTheme = ColorTheme.LightGray;
_chart.Foreground = Brushes.Black;

This is the code for applying the parallel coordinate chart color theme.

When set to light gray theme, the Y-axis text color is changed to white, so the Y-axis text is not visible.

How to change Y axis text color?

Is there a way to directly change the color to the desired color other than the color set in the theme?

Thank you for replying.

Arction_LasseP
Posts: 126
Joined: Wed Mar 27, 2019 1:05 pm

Re: How to change the background color and font color of the parallel coordinate chart

Post by Arction_LasseP » Wed Jul 07, 2021 6:34 am

Hello,

Almost every object in LightningChart has Color, Fill or some property similar to those. These allow you to modify the colors of an individual component. You don't need to use themes for this. In fact, when setting a color theme, it overrides all manual color changes done so far. Therefore, you should always set color theme (if you want to use it, it is not mandatory) before setting colors manually.

Various Y-axis related coloring settings can be found under chart.ViewXY.YAxes[0]. The property you are looking for is most likely Title.Color.

Code: Select all

_chart.ViewXY.YAxes[0].AxisColor = Colors.Red;
_chart.ViewXY.YAxes[0].LabelsColor = Colors.Blue;
_chart.ViewXY.YAxes[0].Title.Color = Colors.Blue;
Best regards,
Lasse

kihoon_sung
Posts: 5
Joined: Fri Jul 02, 2021 8:01 am

Re: How to change the background color and font color of the parallel coordinate chart

Post by kihoon_sung » Thu Jul 08, 2021 2:41 am

AxisY axisYWeight = new AxisY(_chart.ViewXY);
axisYWeight.AxisColor = Colors.Gray;
axisYWeight.LabelsColor = Colors.Gray;
axisYWeight.Title.Color = Colors.Black;
axisYWeight.GridStripColor = Colors.Gray;

I corrected the Y-axis color, but only the grid part appears white.

Arction_LasseP
Posts: 126
Joined: Wed Mar 27, 2019 1:05 pm

Re: How to change the background color and font color of the parallel coordinate chart

Post by Arction_LasseP » Thu Jul 08, 2021 7:11 am

Hello,

There are a couple of more axis grid related coloring settings under MajorDivTickStyle and MajorGrid. There are respective settings for minor ticks and grid as well, but at least the latter are disabled by default (you can show/hide them via Visible property).

Code: Select all

_chart.ViewXY.YAxes[0].MajorDivTickStyle.Color = Colors.Blue;
_chart.ViewXY.YAxes[0].MajorGrid.Color = Colors.Blue;

_chart.ViewXY.YAxes[0].MinorDivTickStyle.Color = Colors.Blue;
_chart.ViewXY.YAxes[0].MinorGrid.Color = Colors.Blue;
Again, if you are setting the ColorTheme somewhere in your code, be sure to change these axis coloring settings after that. Otherwise they will be overridden by the theme change.

Kind regards,
Lasse