Your Privacy Matters: We use our own and third-party cookies to improve your experience on our website. By continuing to use the website we understand that you accept their use. Cookie Policy
935
Color coordinating by parameters between charts
posted

I am currently using AG 12.3 and IG 12.3.

This question builds upon work previously done (AG Composite Chart). As I'm creating multiple charts (one for Design and another in a 3rd tab for Process), users would like to see some color coordination between them.

If the color for the Process "1C (PEFT)" is selected as Blue, then both the Stacked Area and Stacked Line series should be different shades of Blue for "1C (PEFT)" in the Process chart and Designs "AT-AT (1st Order)" and "AT-ST" should have at least 4 different shades of blue between the Stacked Area and Stacked Line series.

Is there a way built in that can service this?

My initial inclination is to go through a color study to establish 5 colors with 5 shades each, then repeat each in arrays and do selection based on `index % 10` logic (in reverse for Stacked Line series). I'd like to avoid this extra work, if possible.

Attaching modified example from previous question.

4544.DynamicStackedChart.zip

Parents
  • 34430
    Offline posted

    Hello Chris,

    The best thing that I can recommend for managing colors in the IgxDataChart would be to utilize the brushes collection of the chart. Here is a link to the API about the brushes collection: https://www.infragistics.com/products/ignite-ui-angular/api/docs/typescript/latest/classes/igxdatachartcomponent.html#brushes.

    In the code example given there, the brushes collection is set to “red, green, blue.” This effectively creates a collection with red at index 0, green at index 1, and blue to index 2. This will map to the series collection of the chart, including the fragments of the stacked series. In other words, the series at index 0 will be red, the series at index 1 will be green, and the series at index 2 will be blue. If there are more than three series, the brushes collection will repeat itself.

    Please let me know if you have any other questions or concerns on this matter.

Reply Children