Skip to content

How to get color of dataset? #503

Answered by RalphSteinhagen
AValov76 asked this question in Q&A
Discussion options

You must be logged in to vote

@AValov76 if you have set them manually via DataSet::setStyle(...), you may want to have a look at the snippets in DefaultRenderColorScheme and retrieve them via for example:

    public static void setLineScheme(final GraphicsContext gc, final String defaultStyle, final int dsIndex) {
        AssertUtils.gtEqThanZero("setLineScheme dsIndex", dsIndex);
        final Map<String, List<String>> map = splitQuery(defaultStyle);


        final Color lineColor = StyleParser.getColorPropertyValue(defaultStyle, XYChartCss.DATASET_STROKE_COLOR);
        final double[] lineDash = StyleParser.getStrokeDashPropertyValue(defaultStyle, XYChartCss.STROKE_DASH_PATTERN);
        final Color rawColor = line…

Replies: 3 comments 8 replies

Comment options

You must be logged in to vote
0 replies
Answer selected by AValov76
Comment options

You must be logged in to vote
8 replies
@ennerf
Comment options

@dirri
Comment options

@wirew0rm
Comment options

@dirri
Comment options

@wirew0rm
Comment options

Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
5 participants