Page 1 of 1

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

Posted: Wed Jul 07, 2021 4:37 am
by kihoon_sung
_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.

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

Posted: Wed Jul 07, 2021 6:34 am
by Arction_LasseP
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

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

Posted: Thu Jul 08, 2021 2:41 am
by kihoon_sung
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.

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

Posted: Thu Jul 08, 2021 7:11 am
by Arction_LasseP
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