Giter Club home page Giter Club logo

Comments (3)

AAChartModel avatar AAChartModel commented on June 18, 2024

参考 Highcharts.js 官方在线文档:

from aachartkit.

AAChartModel avatar AAChartModel commented on June 18, 2024
    let aaOptions = AAOptions()
            .chart(AAChart()
                .type(.pie))
            .title(AATitle()
                .text("Browser market share, January, 2022")
                .align(.left))
            .subtitle(AASubtitle()
//                .text("Source: <a href='http://statcounter.com' target='_blank'>statcounter.com</a>")
                .text("http://statcounter.com")
                .align(.left))
            .plotOptions(AAPlotOptions()
                .pie(AAPie()
//                    .shadow(false)
                    .center(["50%", "50%"])))
            .tooltip(AATooltip()
                .valueSuffix("%"))
            .series([
                AASeriesElement()
                    .name("Browsers")
                    .data(browserData)
                    .size("60%")
                    .dataLabels(AADataLabels()
                        .color(AAColor.white)
                        .distance(-30)),
                AASeriesElement()
                    .name("Versions")
                    .data(versionsData)
                    .size("80%")
                    .innerSize("60%")
                    .dataLabels(AADataLabels()
                        .format(#"<b>{point.name}:<\/b> <span style=\\\"opacity: 0.5\\\">{point.y}%<\/span>"#)
                        .filter(AAFilter()
                            .property("y")
                            .operator(">")
                            .value(1))
                        .style(AAStyle()
                            .fontWeight(.regular)
                        ))
                    .id("versions")
                ])

如上所示, Swift 版本的 demo 中, 有使用示例.

关键内容:

                  .dataLabels(AADataLabels()
                        .format(#"<b>{point.name}:<\/b> <span style=\\\"opacity: 0.5\\\">{point.y}%<\/span>"#)
                        .filter(AAFilter()
                            .property("y")
                            .operator(">")
                            .value(1))
                        .style(AAStyle()
                            .fontWeight(.regular)
                        ))
                    .id("versions")

下载最新 Swift 版本的 demo, 运行及查看效果即可.

from aachartkit.

AAChartModel avatar AAChartModel commented on June 18, 2024

你截图内容说明你的依赖库应该不是最新的.

如果要使用 AAFilter 对象, 你需要在 pod 中更新到最新的 AAChartKit-Swift.

from aachartkit.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.