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. 极其精美而又强大的现代化声明式数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.
https://cocoapods.org/pods/AAChartKit
MIT License
4.71k stars 750 forks source link

饼图类型,当其数据源中的数据值大部分都为 0 的时, dataLabels 显示不全 #1446

Closed mapleleaf99 closed 1 year ago

mapleleaf99 commented 1 year ago
image

如题,如图

mapleleaf99 commented 1 year ago

数据源:

    @[
        @[@"AAAA",   @(0)],
        @[@"BBBB",   @(0)],
        @[@"CCCC",   @(0)],
        @[@"DDDD",   @(0)],
        @[@"EEEE",   @(10)]
    ];
AAChartModel commented 1 year ago

试试类似 JS 这样配置看看:

Highcharts.chart('container', {
  series: [{
    type: 'pie',
    dataLabels: {
      padding: 0,
      style: {
        fontSize: '8px'
      }
    },
    data: [{
      name: 'AAAAA',
      y: 0
   },
   {
      name: 'BBBBB',
      y: 0
   },
   {
      name: 'CCCCC',
      y: 0
   },
   {
      name: 'DDDDD',
      y: 0
   },
   {
      name: 'EEEEE',
      y: 10
   },]
  }]
});
AAChartModel commented 1 year ago
截屏2023-02-15 17 26 09
AAChartModel commented 1 year ago

参考:

mapleleaf99 commented 1 year ago

调节了padding和fontsize还是一样

mapleleaf99 commented 1 year ago

另外log打印出警告提示

image
mapleleaf99 commented 1 year ago
image

这样设置是否有问题

mapleleaf99 commented 1 year ago

调整了size,可以显示了,谢谢

mapleleaf99 commented 1 year ago
image

数据源数据都为0的时候: @[ @[@"AAAA", @(0)], @[@"BBBB", @(0)], @[@"CCCC", @(0)], @[@"DDDD", @(0)], @[@"EEEE", @(0)] ]; ,应该显示五等分吧

mapleleaf99 commented 1 year ago
image

报错信息

AAChartModel commented 1 year ago

参考: