0

我有一个如下所示的图表。

图表

我有两个单独的问题:

  1. 我怎么会有一个“。” accour 作为系列上的千位分隔符(当您将鼠标悬停在数据上时,工具提示中有一个)。我曾尝试研究 plotoptions 和 numberformat,但无法解决这个问题。

  2. 如何解决数据变得如此之小以至于数字难以辨认的问题。

我意识到问题 2 更加开放,但任何想法都将不胜感激。

提前致谢。

图形:

            <script type="text/javascript">
                $(document).ready(function () {
                    Highcharts.setOptions({
                        lang: {
                            thousandsSep: '.'
                        }
                    });

                        var tapegraph = {
                            colors: [
                                     '#525051'
                            ],
                            exporting: { enabled: false },
                        chart: {
                            renderTo: 'tapecontainer',
                            type: 'column'
                        },
                        credits: {
                            enabled: false
                        },
                        title: {
                            text: 'Tapeforbrug'
                        },
                        xAxis: {
                            categories: []
                        },
                        yAxis: {
                            min: 0,
                            title: {
                                text: 'Gigabyte'
                            },
                            stackLabels: {
                                enabled: true,
                                style: {
                                    fontWeight: 'bold',
                                    color: (Highcharts.theme && Highcharts.theme.textColor) || 'gray'
                                }
                            }
                        },
                        legend: {
                            align: 'right',
                            x: -100,
                            verticalAlign: 'top',
                            y: 5,
                            floating: true,
                            backgroundColor: (Highcharts.theme && Highcharts.theme.legendBackgroundColorSolid) || 'white',
                            borderColor: '#CCC',
                            borderWidth: 1,
                            shadow: false
                        },
                        plotOptions: {
                            column: {
                                stacking: 'normal',
                                dataLabels: {
                                    enabled: true,
                                    color: (Highcharts.theme && Highcharts.theme.dataLabelsColor) || 'white'
                                }
                            }
                        },
                        series: []
                    };

                        $.get("../classic_3270/KMDprod1/INFO.CPU.REPORT.MFTAPE" + kunde + ".txt", function (data) {
                            var lines = data.split('\n');
                            lines = data.trim().split('\n');
                        $.each(lines, function (lineNo, line) {
                            var items = line.split(',');

                            if (lineNo == 0) {
                                $.each(items, function (itemNo, item) {
                                    if (itemNo > 0) tapegraph.xAxis.categories.push(item);
                                })
                                ;
                            }

                            else {
                                var series = {
                                    pointWidth: 42,
                                    data: []

                                };
                                $.each(items, function (itemNo, item) {
                                    if (itemNo == 0) {
                                        series.name = item;
                                    } else {
                                        series.data.push(parseFloat(item));
                                    }
                                });

                                tapegraph.series.push(series);
                            }

                        });

                        var chart = new Highcharts.Chart(tapegraph);
4

1 回答 1

0

1) 将千位Sep 设置为“。” 并将工作,请参阅:http: //jsfiddle.net/3bQne/310/

Highcharts.setOptions({
    lang: {
        thousandsSep: '.'
    }
});

2)好吧,您可以隐藏该标签 - 对于此类事情,请使用 dataLabels.formatter 并检查值是否低于总计的 5%,然后决定是否显示该 dataLabel。

于 2013-07-30T11:01:29.933 回答