Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support gauge chart 支持仪表图 #18

Closed
AAChartModel opened this issue May 13, 2020 · 2 comments
Closed

Support gauge chart 支持仪表图 #18

AAChartModel opened this issue May 13, 2020 · 2 comments
Labels
enhancement New feature or request

Comments

@AAChartModel
Copy link
Owner

No description provided.

@AAChartModel AAChartModel added the enhancement New feature or request label May 13, 2020
@AAChartModel
Copy link
Owner Author

Sample One

Configure AAOptions

      fun simpleGaugeChart(): AAOptions {
            return AAOptions()
                .chart(AAChart()
                        .type(AAChartType.Gauge)
                )
                .pane(AAPane()
                        .startAngle(-150f)
                        .endAngle(150f)
                )
                .yAxis(AAYAxis()
                        .min(0f)
                        .max(100f)
                        .plotBands(arrayOf(
                                AAPlotBandsElement()
                                    .from(0f)
                                    .to(60f)
                                    .color("#FF0000")
                            )
                        )
                )
                .series(arrayOf(
                        AASeriesElement()
                            .data(arrayOf(80))
                    )
                )
        }

Final chart

截屏2020-05-09 下午5 57 23

@AAChartModel
Copy link
Owner Author

Sample Two

Configure AAOptions

fun gaugeChartWithPlotBand(): AAOptions {
            return AAOptions()
                .chart(AAChart()
                        .type(AAChartType.Gauge))
                .title(AATitle()
                        .text("速度仪"))
                .pane(AAPane()
                        .startAngle(-150f)
                        .endAngle(150f))
                .yAxis(AAYAxis()
                        .min(0f)
                        .max(200f)
                        .title(AATitle()
                                .text("km/h"))
                        .plotBands(arrayOf(
                                AAPlotBandsElement()
                                    .from(0f)
                                    .to(120f)
                                    .color("#ffc069"),
                                AAPlotBandsElement()
                                    .from(120f)
                                    .to(160f)
                                    .color("#fe117c"),
                                AAPlotBandsElement()
                                    .from(160f)
                                    .to(200f)
                                    .color("#06caf4")
                            )
                        )
                )
                .series(arrayOf(
                        AASeriesElement()
                            .data(arrayOf(80))
                    ))
        }

Final chart

截屏2020-05-11 上午10 32 17

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant