Giter Club home page Giter Club logo

Comments (15)

qiuzy008 avatar qiuzy008 commented on May 16, 2024

作者可以给个联系方式吗,有些问题想特别咨询下,我QQ:759439869

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024
    public AAChartModel xAxisGridLineWidth(Float prop) {
        xAxisGridLineWidth = prop;
        return this;
    }

设置 X轴网格线宽度为0即可不显示网格线.

但是 AAChartModel 的其中几个默认值如下

        xAxisGridLineWidth    = 0f;//X轴网格线宽度 默认为为 0f,即隐藏 X轴网格线
        yAxisLabelsEnabled    = true;
        yAxisGridLineWidth    = 1f;//Y轴网格线宽度默认为 1f

估计你其实是想隐藏 Y轴的网格线.

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024
    public AAChartModel yAxisGridLineWidth(Float prop) {
        yAxisGridLineWidth = prop;
        return this;
    }

同理,可通过 AAChartModel 的此函数设置 Y轴的网格线(即水平网格线)宽度为 0,即可隐藏网格线

from aachartcore.

qiuzy008 avatar qiuzy008 commented on May 16, 2024

好的,感谢,X轴的最大值可以设置吗

from aachartcore.

qiuzy008 avatar qiuzy008 commented on May 16, 2024

.xAxisGridLineWidth(0f) ,这个我刚刚设置了没有作用,网格线还是显示(Android)

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024

你应该没看懂我上面的意思,水平的网格线其实是 Y 轴网格线

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024
.yAxisGridLineWidth(0f) 

即可.

from aachartcore.

qiuzy008 avatar qiuzy008 commented on May 16, 2024

.yAxisGridLineWidth(0f) 这个也是设置了的,Y轴的网格线是没有显示了,但是X轴的还是显示(Android)

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024

你现在的图形效果是什么样子的?,截图看看

from aachartcore.

qiuzy008 avatar qiuzy008 commented on May 16, 2024

image
看看可以看到我截图不

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024

唉,搞了半天原来你说的是 X 轴的刻度线

  AAOptions aaOptions = AAOptionsConstructor.configureChartOptions(aaChartModel);
        aaOptions.xAxis.tickWidth = 0f;

即可隐藏 X轴的刻度线

from aachartcore.

qiuzy008 avatar qiuzy008 commented on May 16, 2024
aaChartModel = new AAChartModel()
                .chartType(AAChartType.Column) //图表类型
                .stacking(AAChartStackingType.Normal) //Normal Percent 堆积类型
                .title("温度图表2")
                .subtitle("温差")
                .categories(new String[]{"周一", "周二", "周三", "周四", "周五", "周六","周日"}) //X轴
//                .backgroundColor("#4b2b7f")
                .dataLabelsEnabled(false)
                .borderRadius(0f)

                .yAxisTitle("") //纵坐标标题
                .yAxisMax(100f)
                .yAxisMin(0f)
                .yAxisLineWidth(0f)
                .yAxisGridLineWidth(0f)

//                .xAxisGridLineWidth(0f)//设置X轴网格线不显示
//                .xAxisVisible(false)  //隐藏X轴

                .gradientColorEnable(true) ////是否要为渐变色
                .colorsTheme(new Object[]{gradientColorDic1,gradientColorDic2,gradientColorDic3})//设置渐变

                .legendEnabled(false) //是否启用图表的图例(图表底部的可点击的小圆点)
                .markerRadius(0f)
                .markerSymbolStyle(AAChartSymbolStyleType.InnerBlank)
                //.colorsTheme(new String[]{"#fe117c","#ffc069","#06caf4","#7dffc0"})//主题颜色数组


                .series(new AASeriesElement[]{element3 ,element2, element1});


        AAOptions aaOptions = AAOptionsConstructor.configureChartOptions(aaChartModel);
        aaOptions.xAxis.tickWidth = 0f;

这样设置之后一样没有作用,X轴的刻度线还是有

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024

这样之后,绘图就应该由

//调用 AAChartModel 绘图
        aaChartView?.aa_drawChartWithChartModel(aaChartModel)

改变为

//调用 AAChartOptions 绘图
        aaChartView.aa_drawChartWithChartOptions(aaOptions);

你是这样做的吗?

from aachartcore.

qiuzy008 avatar qiuzy008 commented on May 16, 2024

嗯嗯,感谢,通过这个做法已经解决这个问题

from aachartcore.

AAChartModel avatar AAChartModel commented on May 16, 2024
    public void aa_drawChartWithChartModel(final AAChartModel chartModel) {
        AAOptions aaOptions = AAOptionsConstructor.configureChartOptions(chartModel);
        this.aa_drawChartWithChartOptions(aaOptions);
    }

请看 AAChartView 中的源码,

  • aa_drawChartWithChartModel 本质上其实还是调用的 aa_drawChartWithChartOptions 方法.

  • 所以在绘图时,只要在这两个方法中选择一个就好(不要两个方法都用,造成重复绘制,浪费计算资源).

  • AAOptions 配置起来更灵活.图表属性更丰富齐全,但用起来相对就没有 AAChartModel 用起来简单.

from aachartcore.

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.