Comments (3)
refer to AAChartModel/AAChartKit#759
from aachartcore-kotlin.
refer to AAChartModel/AAChartKit#763
from aachartcore-kotlin.
Kotlin Version
configure chart options
fun configureDoubleYAxisChartOptions(): AAOptions {
val aaTitle = AATitle()
.text("")
val aaXAxis = AAXAxis()
.visible(true)
.min(0f)
.categories(arrayOf("Java", "Swift", "Python", "Ruby", "PHP", "Go","C",
"C#", "C++", "Perl", "R", "MATLAB", "SQL"))
val aaYAxisTitleStyle = AAStyle()
.color("#1e90ff")//Title font color
.fontSize(14f)//Title font size
.fontWeight(AAChartFontWeightType.Bold)//Title font weight
.textOutline("0px 0px contrast")
val aaYAxisLabels = AALabels()
.enabled(true)//设置 y 轴是否显示数字
.style(AAStyle()
.color("#ff0000")//yAxis Label font color
.fontSize(15f)//yAxis Label font size
.fontWeight(AAChartFontWeightType.Bold))//yAxis Label font weight
val yAxisOne = AAYAxis()
.visible(true)
.labels(aaYAxisLabels)
.title(AATitle()
.text("冬季降雨量")
.style(aaYAxisTitleStyle))
.opposite(true)
val yAxisTwo = AAYAxis()
.visible(true)
.labels(aaYAxisLabels)
.title(AATitle()
.text("夏季降雨量")
.style(aaYAxisTitleStyle))
val aaTooltip = AATooltip()
.enabled(true)
.shared(true)
val gradientColorDic1 = AAGradientColor.linearGradient(
AALinearGradientDirection.ToTop,
"#f54ea2",
"#ff7676"//颜色字符串设置支持十六进制类型和 rgba 类型
)
val gradientColorDic2 = AAGradientColor.linearGradient(
AALinearGradientDirection.ToTop,
"#17ead9",
"#6078ea"//颜色字符串设置支持十六进制类型和 rgba 类型
)
val aaMarker = AAMarker()
.radius(7f)//曲线连接点半径,默认是4
.symbol(AAChartSymbolType.Circle.value)//曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
.fillColor("#ffffff")//点的填充色(用来设置折线连接点的填充色)
.lineWidth(3f)//外沿线的宽度(用来设置折线连接点的轮廓描边的宽度)
.lineColor("")//外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色)
val element1 = AASeriesElement()
.name("2017")
.type(AAChartType.Areaspline)
// .borderRadius(4)
.color(gradientColorDic1)
.marker(aaMarker)
.yAxis(1)
.data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
val element2 = AASeriesElement()
.name("2018")
.type(AAChartType.Column)
.color(gradientColorDic2)
.yAxis(0)
.data(arrayOf(7.0, 6.9, 2.5, 14.5, 18.2, 21.5, 5.2, 26.5, 23.3, 45.3, 13.9, 9.6))
return AAOptions()
.title(aaTitle)
.xAxis(aaXAxis)
.yAxisArray(arrayOf(yAxisOne, yAxisTwo))
.tooltip(aaTooltip)
.series(arrayOf(element1, element2))
}
final chart
from aachartcore-kotlin.
Related Issues (20)
- sleepChart
- Faded issue on click of chart HOT 3
- 求助
- 折线图X轴显示不全,求大佬指教 HOT 2
- 请问是否支持绘制桑基图
- slicedOffset
- The charts are not displayed throughout the app HOT 1
- android AASeriesElement 没有这个 pointPlacement 配置 ,请问如何让雷达图第一项指北,谢谢 HOT 2
- setTooltipEnabled ,怎么动态关闭浮窗的,我用removeallview,但是连曲线都重置了 HOT 1
- 为什么我这个布局和代码不能显示图表
- Is there any event when clicking on the AATooltip?
- Why first series element always on top in column stacked chart HOT 2
- Method chartViewMoveOverEventMessage not override
- X轴坐标如何自定义 HOT 1
- 怎么设置只有部分图表可以点击 HOT 1
- 调用chart.tooltip.refresh(points); 没有回调chartViewMoveOverEventMessage(aaChartView: AAChartView, messageModel: AAMoveOverEventMessageModel)
- 最新7.2.1版本获取不到AAOptions对象
- 当有多条折线时,添加AAChartEvents,只有一条折线上显示了选中默认点 HOT 1
- Is there a way to disable stickyTracking? HOT 2
- [建议] 能否和Glide库一样自带混淆规则
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from aachartcore-kotlin.