Comments (6)
If you want to update AAOptions
for AAChartView
, you can try this method in the AAChartView.java
:
/// A common chart update function
/// (you can update any chart element) to open, close, delete, add, resize, reformat, etc. elements in the chart.
/// Refer to https://api.highcharts.com/highcharts#Chart.update
///
/// It should be noted that when updating the array configuration,
/// for example, when updating configuration attributes including arrays such as xAxis, yAxis, series, etc., the updated data will find existing objects based on id and update them. If no id is configured or passed If the id does not find the corresponding object, the first element of the array is updated. Please refer to this example for details.
///
/// In a responsive configuration, the response of the different rules responsive.rules is actually calling chart.update, and the updated content is configured in chartOptions.
///
/// - Parameter options: A configuration object for the new chart options as defined in the options section of the API.
/// - Parameter redraw: Whether to redraw after updating the chart, the default is true
public void aa_updateChartWithOptions(
Object options,
Boolean redraw
) {
boolean isAAOptionsClass = options instanceof AAOptions;
String finalOptionsMapStr;
if (isAAOptionsClass) {
String aaOptionsMapStr = new Gson().toJson(options);
finalOptionsMapStr = aaOptionsMapStr;
} else {
String classNameStr = options.getClass().getSimpleName();
classNameStr = classNameStr.replace("AA","");
//convert fist character to be lowercase string
String firstChar = classNameStr.substring(0,1);
String lowercaseFirstStr = firstChar.toLowerCase();
classNameStr = classNameStr.substring(1);
String finalClassName = lowercaseFirstStr + classNameStr;
Map<String, Object> finalOptionsMap = new HashMap();
finalOptionsMap.put(finalClassName,options);
String optionsStr = new Gson().toJson(finalOptionsMap);
finalOptionsMapStr = optionsStr;
}
String javaScriptStr = "updateChart('" + finalOptionsMapStr + "','" + redraw + "')";
this.safeEvaluateJavaScriptString(javaScriptStr);
}
you can find some usage samples in the AAChartCore-Kotlin
demo.
Refer to the API doc online:
from aachartcore-kotlin.
what's the version that you use ? because in version com.github.AAChartModel:AAChartCore-Kotlin:7.1.0 , the function still like this
from aachartcore-kotlin.
Apologies for the mistake, the code snippet I shared is from the Java version of AAChartCore
library.
from aachartcore-kotlin.
In any case, these two codes functionally serve the same purpose, they merely differ in terms of language version.
from aachartcore-kotlin.
i've change the version from 7.1.0 to 7.2.0, and the function aa_updateChartWithOptions seems working
i think there's some change in the function, but i have new issues , why the dataLabelsEnabled is still visible when i set to false ? and the tooltip is not showing, like the new aaChartModel not applied anything
this is how do i apply it for the first time
from aachartcore-kotlin.
in the config i set the tooltip to enabled, but the tooltip javascript now showing
from aachartcore-kotlin.
Related Issues (20)
- 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库一样自带混淆规则
- How can I change the size of the font of the xAxis and yAxis? HOT 3
- 大神,pro版本什么时候能上啊?目前还不支持sankey! HOT 2
- 如何禁用图例的点击事件 HOT 8
- 使用yAxisMax = 220,但是画出来的图标却是400 HOT 5
- 图表无法左右滑动 HOT 1
- AAChartView 内的方法有具体的介绍说明文章吗? HOT 5
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.