AAChartModel / AAChartCore

📈📊☕️☕️☕️An elegant modern declarative data visualization chart framework for Android. 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.极其精美而又强大的 Android 数据可视化图表框架,支持柱状图、条形图、折线图、曲线图、折线填充图、曲线填充图、气泡图、扇形图、环形图、散点图、雷达图、混合图等各种类型的多达几十种的信息图图表,完全满足工作所需.
Apache License 2.0
921 stars 129 forks source link

箱线图样式问题 #158

Closed yuexuanchen closed 2 years ago

yuexuanchen commented 2 years ago

请问箱线图顶部和底部的横线样式有开放的方法可以直接控制样式吗?

AAChartModel commented 2 years ago

参考:

AAChartModel commented 2 years ago

Java 版本的写法:

    public static AAOptions configureBoxplotChartWithSpecialStyle() {
        AAChartModel aaChartModel = new AAChartModel()
                .chartType(AAChartType.Boxplot)//图表类型
                .title("BOXPLOT CHART")//图表主标题
                .subtitle("virtual data")//图表副标题
                .yAxisTitle("℃")//设置 Y 轴标题
                .yAxisVisible(true)//设置 Y 轴是否可见
                .series(new AASeriesElement[]{
                        new AASeriesElement()
                                .name("Observed Data")
                                .color("#ef476f")
                                .fillColor("#04d69f")
                                .data(new Object[][]{
                                        {760, 801, 848, 895, 965},
                                        {733, 853, 939, 980, 1080},
                                        {714, 762, 817, 870, 918},
                                        {724, 802, 806, 871, 950},
                                        {834, 836, 864, 882, 910}
                                }),
                });

        AAOptions aaOptions = aaChartModel.aa_toAAOptions();

        aaOptions.plotOptions
                .boxplot(new AABoxplot()
                        .boxDashStyle(AAChartLineDashStyleType.Dash)
                        .fillColor("#F0F0E0")
                        .lineWidth(2)
                        .medianColor("#0C5DA5")
                        .medianDashStyle(AAChartLineDashStyleType.ShortDot)
                        .medianWidth(3)
                        .stemColor("#A63400")
                        .stemDashStyle(AAChartLineDashStyleType.Dot)
                        .stemWidth(1)
                        .whiskerColor("#3D9200")
                        .whiskerDashStyle(AAChartLineDashStyleType.Solid)
                        .whiskerLength("60%")
                        .whiskerWidth(6)
                );

        aaOptions.plotOptions.series
                .pointWidth(100);

        return aaOptions;
    }
AAChartModel commented 2 years ago

备注:

新增的 AABoxplot 需要更新 AAChartCore 至最新内容, 方可使用.