AAChartModel / AAChartKit

📈📊🚀🚀🚀An elegant modern declarative data visualization chart framework for iOS, iPadOS and macOS. Extremely powerful, supports line, spline, area, areaspline, column, bar, pie, scatter, angular gauges, arearange, areasplinerange, columnrange, bubble, box plot, error bars, funnel, waterfall and polar chart types. 极其精美而又强大的现代化声明式数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.

Home Page:https://cocoapods.org/pods/AAChartKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

柱形范围图给的两个值相同,表中不显示

lgwResources opened this issue · comments

commented

你好,我想问下柱形范围图给的最大最小值一样,在表中能显示出图来么

使用 JavaScript 配置 Highcharts:

Highcharts.chart('container', {

    chart: {
        type: 'columnrange',
        inverted: true
    },

    title: {
        text: 'Temperature variation by month'
    },

    subtitle: {
        text: 'Observed in Vik i Sogn, Norway, 2021 | ' +
            'Source: <a href="https://www.vikjavev.no/ver/" target="_blank">Vikjavev</a>'
    },

    xAxis: {
        categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun',
            'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
    },

    yAxis: {
        title: {
            text: 'Temperature ( °C )'
        }
    },

    tooltip: {
        valueSuffix: '°C'
    },

    plotOptions: {
        columnrange: {
            borderRadius: '50%',
            dataLabels: {
                enabled: true,
                format: '{y}°C'
            }
        },
        series: {
            minPointLength: 3
        }
    },
   

    legend: {
        enabled: false
    },

    series: [{
        name: 'Temperatures',
        data: [
            [-13.9, 5.2],
            [-16.7, 10.6],
            [0, 0],
            [-4.4, 16.8],
            [-2.1, 27.2],
            [5.9, 29.4],
            [6.5, 29.1],
            [4.7, 25.4],
            [4.3, 21.6],
            [-3.5, 15.1],
            [-9.8, 12.5],
            [-11.5, 8.4]
        ]
    }]

});

可以看到效果如下:
截屏2023-11-16 15 56 15

由图中显示的内容可以看出: 值为 [0, 0], 的地方, 仍有宽度为 3 的棱柱, 其中起作用的关键内容为:

plotOptions: {
        ...
        ...
        series: {
            minPointLength: 3 //柱状图, 条形图, 柱形范围图, 瀑布图, 箱线图(盒须图)直接设置单个图形元素的最小高度
        }
    },

 

你可以在这个在线编辑工具中测试此示例代码:

关键属性 minPointLength 请参考在线文档:

commented

我用的AAChartKit-Pro ,因为需要用到AAChartTypeXrange,但是这里好像没有这个属性

commented

我按照AAChartKitLib库中的AASeries和AAColumn中添加了minPointLength属性 可以显示出来了