0

我正在尝试更改 jqchart 工具提示的颜色,但没有任何成功。

我只是成功地改变了线条的颜色。

在我构建 jqchart 的代码下方:

$('#jqChartMes').jqChart({
    title: { text: 'Mensal' },
    border: { lineWidth: 0 },
    legend: { location: 'bottom' },
    animation: { duration: 1 },
    dataSource: porMes,
    axes: [
        {
            type: 'line',
            location: 'left',
            minimum: -5,
            maximum: 110,
            interval: 50
        }
    ],
    series: [
        {
            type: 'line',
            title: 'Disponibilidade na Falha',
            strokeStyle: '#00F',
            lineWidth: 1,
            xValuesField: {
                name: 'MES',
                type: 'string' // string, numeric, dateTime
            },
            yValuesField: 'DISP_FALHA'
        },
        {
            type: 'line',
            title: 'Disponibilidade Geral',
            strokeStyle: '#FCB441',
            lineWidth: 1,
            xValuesField: {
                name: 'MES',
                type: 'string' // string, numeric, dateTime
            },
            yValuesField: 'DISP_GERAL'
        },
        {
            type: 'line',
            title: 'Efetividade',
            strokeStyle: '#00A65A',
            lineWidth: 1,
            xValuesField: {
                name: 'MES',
                type: 'string' // string, numeric, dateTime
            },
            yValuesField: 'EFETIV',
        }
    ]
});

我在 jqchart 网站上进行了很多搜索以尝试解决我的问题,但没有成功。请大家帮帮我。

4

1 回答 1

0

如果要更改工具提示的颜色,则必须转到下载时提供的 jquery.jqChart.css 文件

在那里你会找到这个代码段:

.ui-jqchart .ui-jqchart-tooltip { position: absolute; white-space: nowrap; padding: .2em .4em; z-index: 9999; border: 1px solid #dddddd; color: #333333; background: white; -moz-border-radius: 4px; -webkit-border-radius: 4px; border-radius: 4px; -o-box-shadow: 0 0 5px #aaa; -moz-box-shadow: 0 0 5px #aaa; -webkit-box-shadow: 0 0 5px #aaa; box-shadow: 0 0 5px #aaa; }

这里的颜色:#333333 是您可以更改为任何您想要的颜色。

我希望这有帮助 :)

于 2016-03-12T19:05:01.653 回答