Home forums Feature Requests & Feedback define color in the options

This topic contains 4 replies, has 2 voices, and was last updated by  Daniel Silva 2 years, 4 months ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #6487

    Daniel Silva
    Participant

    Hi,

    I’m building a simple chart editor and having a problem when reading the color of the series.
    I don’t define a color for all series and they are retrieved from the colorSet. In this cases I cant later read the used color.
    Is possible to alter the chart.options.data[] to include this value?

    color = dataPoints[i].color ? dataPoints[i].color : dataSeries._colorSet[i % dataSeries._colorSet.length];
    if(!dataPoints[i].color) dataPoints[i].color=color;
    • This topic was modified 2 years, 4 months ago by  Daniel Silva.
    #6492

    Anjali
    Participant

    Hi,
    You can read the used colors which are explicitly given to data. By default color retrieved from the colorSet cant be read as of now.

    #6495

    Daniel Silva
    Participant

    Only if the color is defined when building the chart, automatic colors are not displayed,

    #6497

    Anjali
    Participant

    Hi,

    Yes, you can only read colors when you set them explicitly. Default colors are not exposed yet.

    But we do have a workaround where you can assign a custom colorSet and determine dataPoint’s color from it – dataPoints are assigned color in a sequential order. Checkout this example.

    #6498

    Daniel Silva
    Participant

    Thanks

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.