Comments (4)
参考:
- AAChartModel/AAChartKit#901
- AAChartModel/AAChartKit#952
- AAChartModel/AAChartKit#1324
- AAChartModel/AAChartKit#1330
from aachartcore.
其中主要的参考示例:
此示例的 Java 版本的配置方式如下:
//https://github.com/AAChartModel/AAChartKit/issues/1324
//https://github.com/AAChartModel/AAChartKit/issues/1330
public static AAOptions configureTheAxesLabelsFormattersOfDoubleYAxesChart3() {
AAChart aaChart = new AAChart()
.backgroundColor(AAColor.White);
AATitle aaTitle = new AATitle()
.text("");
AAXAxis aaXAxis = new AAXAxis()
.visible(true)
.min(0)
.categories(new String[]{
"Java", "Swift", "Python", "Ruby", "PHP", "Go","C",
"C#", "C++", "Perl", "R", "MATLAB", "SQL"
});
AAPlotOptions aaPlotOptions = new AAPlotOptions()
.series(new AASeries()
.marker(new AAMarker()
.radius(7)//曲线连接点半径,默认是4
.symbol(AAChartSymbolType.Circle)//曲线点类型:"circle", "square", "diamond", "triangle","triangle-down",默认是"circle"
.fillColor(AAColor.White)//点的填充色(用来设置折线连接点的填充色)
.lineWidth(3)//外沿线的宽度(用来设置折线连接点的轮廓描边的宽度)
.lineColor("")//外沿线的颜色(用来设置折线连接点的轮廓描边颜色,当值为空字符串时,默认取数据点或数据列的颜色)
));
AAYAxis yAxis1 = new AAYAxis()
.visible(true)
.lineWidth(1)
.tickPositions(new Object[]{0, 50, 100, 150, 200})
.labels(new AALabels()
.enabled(true)
.style(new AAStyle()
.color("DodgerBlue"))
.formatter("function () {\n" +
" var yValue = this.value;\n" +
" var unitStr = \"千\";\n" +
" if (yValue == 0) {\n" +
" unitStr = \"\";\n" +
" }\n" +
" var formattedYValue = (yValue / 1000).toFixed(3) + unitStr;\n" +
" return formattedYValue;\n" +
" }"))//Y轴文字数值为 0 的时候, 不显示单位
.gridLineWidth(0)
.title(new AATitle()
.text("以「千」为单位")
.style(AAStyle.style("DodgerBlue", 14, AAChartFontWeightType.Bold)));
AAYAxis yAxis2 = new AAYAxis()
.visible(true)
.lineWidth(1)
.tickPositions(new Object[]{0, 50, 100, 150, 200})
.labels(new AALabels()
.enabled(true)
.style(new AAStyle()
.color(AAColor.Red))
.formatter("function () {\n" +
" var yValue = this.value;\n" +
" var unitStr = \"万\";\n" +
" if (yValue == 0) {\n" +
" unitStr = \"\";\n" +
" }\n" +
" var formattedYValue = (yValue / 10000).toFixed(4) + unitStr;\n" +
" return formattedYValue;\n" +
" }"))//Y轴文字数值为 0 的时候, 不显示单位
.gridLineWidth(0)
.title(new AATitle()
.text("以『万』为单位")
.style(AAStyle.style(AAColor.Red, 14, AAChartFontWeightType.Bold)))
.opposite(true)
;
AATooltip aaTooltip = new AATooltip()
.enabled(true)
.shared(true);
AASeriesElement[] seriesArr = {
new AASeriesElement()
.name("2020")
.type(AAChartType.Spline)
.lineWidth(7)
.color(AAGradientColor.DeepSea)
.borderRadius(4)
.yAxis(1)
.data(new Object[]{
0, 71.5, 106.4, 129.2, 144.0, 176.0,
135.6, 148.5, 216.4, 194.1, 95.6, 54.4
}),
new AASeriesElement()
.name("2021")
.type(AAChartType.Spline)
.lineWidth(7)
.color(AAGradientColor.Sanguine)
.yAxis(0)
.data(new Object[]{
135.6, 148.5, 216.4, 194.1, 95.6, 54.4,
0, 71.5, 106.4, 129.2, 144.0, 176.0
})
};
AAOptions aaOptions = new AAOptions()
.chart(aaChart)
.title(aaTitle)
.plotOptions(aaPlotOptions)
.xAxis(aaXAxis)
.yAxisArray(new AAYAxis[]{yAxis1, yAxis2})
.tooltip(aaTooltip)
.series(seriesArr);
return aaOptions;
}
demo 中有此示例, 下载运行查看即可.
from aachartcore.
//https://github.com/AAChartModel/AAChartKit/issues/901
//https://github.com/AAChartModel/AAChartKit/issues/952
public static AAOptions configureTheAxesLabelsFormattersOfDoubleYAxesChart() {
...
...
}
//https://github.com/AAChartModel/AAChartKit/issues/1324
public static AAOptions configureTheAxesLabelsFormattersOfDoubleYAxesChart2() {
...
...
}
//https://github.com/AAChartModel/AAChartKit/issues/1324
//https://github.com/AAChartModel/AAChartKit/issues/1330
public static AAOptions configureTheAxesLabelsFormattersOfDoubleYAxesChart3() {
...
...
}
Java 版本的 demo
中, 这三个是相似关联的双 Y 轴示例, 可对比参考查看.
from aachartcore.
2.如何去掉X轴基线
设置 Y
轴轴线的宽度为 0
即可.
from aachartcore.
Related Issues (20)
- Y轴重定义值问题 HOT 3
- Y轴数据单位刷新后会改变 HOT 2
- 范围视图在数据的min=max时,图表上显示空白,有什么办法显示点东西出来? HOT 3
- android端某些图表点击不能显示浮层AATooltip
- Android版本能不能像轮播图一样滑动,一次滑动一个屏幕的宽度?
- Android版能不能设置X轴间隔的固定宽度?
- 请问Android版如何修改横纵坐标的个数?默认的是12个,并且修改坐标点的字体大小以及点位的数值大小? HOT 5
- Android版柱状图的X轴数据超过1000时绘制不出来 HOT 1
- 请问当Y轴数据均为0时,怎么让Y轴0起点在X轴呢?yAxisMin()没效果 HOT 1
- 放在dataBinding 的布局里,直接找不到路径了,不支持吗 HOT 1
- Android版是否不支持桑基图
- 如何动态滚动刷新呀 HOT 1
- 可以添加空数据时设置view吗 HOT 5
- pie设置 HOT 1
- 折线图X轴首位坐标问题,以及marker光圈问题请教 HOT 4
- Y轴数据显示精度问题 HOT 1
- In your readme file, there is a typo: The package name should be com.github.AAChartModel.AAChartCore.AAChartCreator.AAChartView, not com.github.AAChartModel.AAChartCore.AAChartConfiger.AAChartView
- In build.gradle, it should be implementation 'com.github.AAChartModel:AAChartCore:cad1a66ee3', SNAPSHOT does not work. HOT 3
- `setClearBackgroundColor(true)`, 在 `android 4.4.2` 上无效,背景仍是白色的 HOT 9
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.