Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Legend label color is always black #41

Closed
warenbe opened this issue Mar 2, 2018 · 1 comment
Closed

Legend label color is always black #41

warenbe opened this issue Mar 2, 2018 · 1 comment

Comments

@warenbe
Copy link

warenbe commented Mar 2, 2018

Version

Development Environment

OS: Windows 10 x64
Browser: Firefox & chrome (latest version)

Current Behavior

Legend label color is always black, even when i set another color on the theme.
image

    var DEFAULT_COLOR = '#ffffff';
    var DEFAULT_BACKGROUND = '#000000';
    var DEFAULT_FONTWEIGHT = 'normal';
    var DEFAULT_FONT = 'Roboto';
    var EMPTY = '';
    var DEFAULT_AXIS = {
        tickColor: DEFAULT_COLOR,
        title: {
            fontSize: 12,
            fontFamily: EMPTY,
            color: DEFAULT_COLOR,
            fontWeight: DEFAULT_FONTWEIGHT
        },
        label: {
            fontSize: 12,
            fontFamily: EMPTY,
            color: DEFAULT_COLOR,
            fontWeight: DEFAULT_FONTWEIGHT
        }
    };

    var charttheme = {
        chart: {
            background: {
                color: DEFAULT_BACKGROUND,
                opacity: 0
            },
            fontFamily: DEFAULT_FONT
        },
        title: {
            fontSize: 18,
            fontFamily: EMPTY,
            color: DEFAULT_COLOR,
            fontWeight: DEFAULT_FONTWEIGHT
        },
        yAxis: DEFAULT_AXIS,
        xAxis: DEFAULT_AXIS,
        plot: {
            lineColor: '#dddddd',
            background: '#ffffff',
            label: {
                fontSize: 11,
                fontFamily: DEFAULT_FONT,
                color: '#888'
            }
        },
        series: {
            label: {
                fontSize: 11,
                fontFamily: DEFAULT_FONT,
                color: DEFAULT_COLOR,
                fontWeight: DEFAULT_FONTWEIGHT
            },
            colors: [ '#62923E', '#C90509', '#ac4142', '#d28445', '#f4bf75', '#90a959', '#75b5aa', '#6a9fb5', '#aa759f', '#8f5536'],
            borderColor: EMPTY,
            borderWidth: EMPTY,
            selectionColor: EMPTY,
            startColor: '#F4F4F4',
            endColor: '#345391',
            overColor: '#F0C952',
            dot: {
                fillColor: EMPTY,
                fillOpacity: 1,
                strokeColor: EMPTY,
                strokeOpacity: 1,
                strokeWidth: 2,
                radius: 2,
                hover: {
                    fillColor: EMPTY,
                    fillOpacity: 1,
                    strokeColor: EMPTY,
                    strokeOpacity: 0.8,
                    strokeWidth: 3,
                    radius: 4
                }
            },
            ranges: []
        },
        legend: {          
            label: {
                fontSize: 12,
                fontFamily: DEFAULT_FONT,
                color: "white",
                fontWeight: DEFAULT_FONTWEIGHT
            }
        },
        tooltip: {},
        chartExportMenu: {
            backgroundColor: '#fff',
            borderRadius: 0,
            borderWidth: 1,
            color: '#000'
        }
    };

    tui.chart.registerTheme('charttheme', charttheme);

    //Creation du graphique
    var container = $("#divrepartitiontype").find('.result-graph')[0];
    var data = {
        categories: ["Types d'appels"],
        series: [
            {
                name: "Entrants",
                data: repartitionpartype.repartition[1].count
            },
            {
                name: "Sortants",
                data: repartitionpartype.repartition[2].count
            }
        ]
    }
    var options = {
        chart: {
            width: $(container).width(),
            height: 200
        },
        legend: {
            showCheckbox: false
        },
        series: {
            radiusRange: ['70%', '100%']
        }
    };
    options.theme = 'charttheme';
    tui.chart.pieChart(container, data, options);

Expected Behavior

Color of the legend should change when you set a different label color.

@youjung-hong
Copy link
Contributor

Hello, @warenbe
This is a bug, the code to set the text color is missing.
It will be fixed on next release.
Thank you for reporting it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants