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

扇形图偶现显示不全的问题 #1415

Closed losedMemory closed 1 year ago

losedMemory commented 1 year ago

5a1a33d6d0d58833420be3000f5556d6

手机型号: iPhone13 系统版本: iOS 15.6.1 AAChartKit (7.3.0)

        AAChartView *chartView = [[AAChartView alloc]init];
        chartView.opaque = NO;
        chartView.scrollEnabled = NO;
        self.chartView = chartView;

        chartView.frame = CGRectMake(15, 5, 150, 150);
        chartView.centerY = self.centerY;
        chartView.backgroundColor = kWhite100;
        [self addSubview:chartView];

        [chartView aa_drawChartWithOptions:[self createOptions]];

- (AAOptions *)createOptions {

    AAChartModel *aaChartModel= AAObject(AAChartModel)
        .marginSet(AAMargin(10, 10, 10, 10))
        .backgroundColorSet(kIsNight ? @"#0F1521" : @"#ffffff")
        .chartTypeSet(AAChartTypePie)
        .colorsThemeSet(self.colorsArray)
        .dataLabelsEnabledSet(false)
        .legendEnabledSet(false)
        .seriesSet(@[
            AASeriesElement.new
            .innerSizeSet(@"60%")
            .sizeSet(@(144))
            .allowPointSelectSet(false) // 是否允许在点击数据点标记(扇形图点击选中的块发生位移)
            .statesSet(AAStates.new.hoverSet(AAHover.new.enabledSet(false))) //禁用点击区块之后出现的半透明遮罩层
            .dataSet(self.valueArray)
        ]);

    AAOptions *aaOptions = [AAOptionsConstructor configureChartOptionsWithAAChartModel:aaChartModel];

    aaOptions.plotOptions.series.states = AAStates.new
    .inactiveSet(AAInactive.new
                 .enabledSet(false));

    // 提示框
    aaOptions.tooltip
    .animationSet(false)
    .shadowSet(false)
    .borderRadiusSet(@4)
    .sharedSet(false)
    .backgroundColorSet((kIsNight ? @"#0F1521" : @"#ffffff"))
    .styleSet(AAStyleColor(kIsNight ? @"#CFD2E9" : @"#242B32"))
    .useHTMLSet(true)
    .formatterSet((@AAJSFunc(function () {
        var colorDot = "<span style=\'color:" + this.color + "\'> ◉ </span>";
        return colorDot + this.point.name +  ': ' + this.y + '%';
    })));
    return aaOptions;
}

偶现,而且别的手机没发现这个问题

AAChartModel commented 1 year ago

调整一下

或者

试试看

AAChartModel commented 1 year ago

参考镜像问题:

losedMemory commented 1 year ago

调整一下 AAChart 类的 margin 或者 AASeriesElement 的 size 试试看

我把size调整了,现在是没问题了,等有问题再看,多谢解答