0

echarts を使用して、次のデータセットの各列のヒストグラムをプロットしようとしています ここに画像の説明を入力

「製品ID」と「タイプ」の列を削除すると、ヒストグラムは正常に機能します。しかし、それらを追加すると、上記のエラーが発生します。これらの列にどのような問題があり、ヒストグラムの生成が停止するのかを理解しようとしています

以下はコードです

    // Based on the prepared dom, initialize the echarts instance
    var histogram_data = '{{ data|safe }}';
    histogram_data = JSON.parse(histogram_data);
index="{{index}}";
var i=1;
for (column in histogram_data){
//alert(column);

if (column==index)
continue;


if(document.getElementById(i)!=null){
var myChart = echarts.init(document.getElementById(i));
    // Specify the configuration items and data of the chart
    var girth = Object.values(histogram_data[column]);
    var bins = ecStat.histogram(girth);


    var option = {
        grid: {
            top: '10%',
            left: '3%',
            right: '10%',
            bottom: '3%',
            containLabel: false
        },
        xAxis: {
            type: 'category',
            axisLabel: {
                show: false
            },
            axisTick: {
                show: false
            },
            axisLine: {
                symbol: ['none', 'arrow'],
                symbolSize: [5, 7],
                lineStyle: {
                    color: '#979797'
                }
            }
        },
        yAxis: {
            type: 'value',
            axisLabel: {
                show: false
            },
            axisTick: {
                show: false
            },
            splitLine: {
                show: false
            },
            axisLine: {
                symbol: ['none', 'arrow'],
                symbolSize: [5, 7],
                lineStyle: {
                    color: '#979797'
                }
            }
        },
        series: [{
            data: bins.data,
            type: 'bar',
            barCategoryGap: '40%', //Adjust column width
            itemStyle: {
                color: '#62A1A9' //Set the column color
            },
            emphasis: {
                itemStyle: {
                    color: '#2F4654', //change column color when hovering
                    // shadowColor: 'rgba(102,102,102,0.50)',
                    // shadowOffsetX: 0,
                    // shadowOffsetY: 2,
                    // shadowBlur: 6,
                    borderWidth: 4,
                    borderColor: '#2F4654',
                    borderType: 'solid'
                }
            },
        }]
    };








    // Use the configuration items and data just specified to display the chart.
    myChart.setOption(option);



//////////////////////
}

i++;

// end for loop
}

とデータ

4

0 に答える 0