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

不好意思,想问下,折线图的多条路径能否反向生成,就是第一项指标对应的路径在最上边,然后第二项在下边,依次类推,我的意思是能否自由设置添加路径的顺序 #11

Closed
ZFKK opened this issue Apr 22, 2017 · 4 comments

Comments

@ZFKK
Copy link

ZFKK commented Apr 22, 2017

No description provided.

@AAChartModel
Copy link
Owner

给个设计的效果图呗,你这样的描述让我很难明白你实际的具体需求呀!

@ZFKK
Copy link
Author

ZFKK commented May 1, 2017

img_2070
img_2069
实际要求的曲线顺序是2069,而现在的是2070的,现在需要的就是更改顺序

@ZFKK
Copy link
Author

ZFKK commented May 1, 2017

补充一下,2069指的是第二张图,也就是现在需要的,而现在的效果是第一张图,也就是2070

@AAChartModel
Copy link
Owner

AAChartModel commented May 2, 2017

我大概明白你的需求了, 你如果想要改变某一个颜色的图层的层次,其实只要调整 AAChartModel的属性series的数组中的数组的先后顺序就可以了.比如你这样配置 AAChartModel :

 self.chartModel= AAObject(AAChartModel)
    .chartTypeSet(chartType)
    .titleSet(@"编程语言热度")
    .subtitleSet(@"虚拟数据")
    .categoriesSet(@[@"Java",@"Swift",@"Python",@"Ruby", @"PHP",@"Go",@"C",@"C#",@"C++"])
    .yAxisTitleSet(@"摄氏度")
    .pointHollowSet(true)
    .seriesSet(@[
                 AAObject(AASeriesElement)
                 .nameSet(@"2018")
                 .dataSet(@[@45,@56,@34,@43,@65,@56,@47,@28,@49]),
                 
                  AAObject(AASeriesElement)
                 .nameSet(@"2019")
                 .dataSet(@[@31,@22,@33,@54,@35,@36,@27,@38,@39]),
                 
                 AAObject(AASeriesElement)
                 .nameSet(@"2020")
                 .dataSet(@[@21,@22,@19,@24,@33,@26,@18,@28,@33]),
                 ]
               )
    ;

渲染的图表如下图所示
36aadcac-db21-460d-8dea-280b460d8f8a

你再调整AAChartModel 的属性series (数组)元素的先后顺序为

seriesSet(@[
                 AAObject(AASeriesElement)
                 .nameSet(@"2020")
                 .dataSet(@[@21,@22,@19,@24,@33,@26,@18,@28,@33]),
                 
                  AAObject(AASeriesElement)
                 .nameSet(@"2019")
                 .dataSet(@[@31,@22,@33,@54,@35,@36,@27,@38,@39]),
                 
                 AAObject(AASeriesElement)
                 .nameSet(@"2018")
                 .dataSet(@[@45,@56,@34,@43,@65,@56,@47,@28,@49]),
                 ]
               )

这时候渲染的图形效果如下
3dcd1a72-6e3d-4b5e-baca-5c2ba1cf7af5

经过如上的改动 AAChartModel 的属性series(数组) 的元素的先后顺序,图表的图层上下层的先后顺序效果也就相应的改变了.

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

No branches or pull requests

2 participants