PxPlus User Forum

Main Board => Discussions => Programming => Topic started by: David Reynolds on August 24, 2018, 11:52:24 AM

Title: Chart Colours
Post by: David Reynolds on August 24, 2018, 11:52:24 AM
Given chart data
1/2/3/4/5/6/
How do I assign a different default colour set?
i.e. rather than the default of Light Red, Light Green, Light Blue, Light Yellow, Magenta, Cyan I would rather have Light Green, Cyan, Magenta, Light Blue, Light Yellow, Light Red
Perferably the built-in PxPlus Chart, but could switch to "fusionfree" or "google" if necessary (I see that they both have the 'Set_Clr$() method - but I don't know the call syntax)
Thanks
Title: Re: Chart Colours
Post by: David Reynolds on August 24, 2018, 12:31:27 PM
Never mind...I found
%NOMADS'Chart_Colors$
Title: Re: Chart Colours
Post by: Jane Raymond on August 24, 2018, 02:03:23 PM

FWIW, there are several ways to control the colors used in a chart. They can be set in the Chart Presets, or using the global variable %Nomads'Chart_Colors$, and via a template file in iNomads. Here's the url for the doc:  https://manual.pvxplus.com/PXPLUS/Charting%20Alternatives%20in%20PxPlus/Colors/Overview.htm (https://manual.pvxplus.com/PXPLUS/Charting%20Alternatives%20in%20PxPlus/Colors/Overview.htm)
Title: Re: Chart Colours
Post by: David Reynolds on August 24, 2018, 03:12:48 PM
In my PreDisplay logic I have:
%Nomad_Chart$="google"

Then I tried each of:
1. %Nomad_Chart_Colors$="Light Green/Light Cyan/Light Magenta/Light Blue/Light Yellow/Light Red/"
2. %Nomads'Chart_Colors$="Light Green/Light Cyan/Light Magenta/Light Blue/Light Yellow/Light Red/"
3. %INomads_Template$="MyChartTemplate" (where I created lib/_plus/inomads/templates/MyChartTemplate/chart_clrs.txt)

To no avail.
I also tried them all with %Nomad_Chart$="" (native) with no luck.

I ultimately had to put
MyChart.ctl'currentset=1,MyChart.ctl'TextColour$="Light Green"
MyChart.ctl'currentset=2,MyChart.ctl'TextColour$="Light Cyan"
etc, etc

Is there something I'm missing?
Title: Re: Chart Colours
Post by: Jane Raymond on August 24, 2018, 03:37:51 PM
David,
Check if you have colors set in the Chart Presets, as they will take precedence over the colors in %nomads'chart_colors$.
Title: Re: Chart Colours
Post by: David Reynolds on August 27, 2018, 10:46:56 AM
No presets.

I have a working model now using 'CurrentSet and 'TextColour$
If you want to continue this off-list, that would be fine.
Or not. :)

Thanks