-
Notifications
You must be signed in to change notification settings - Fork 119
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
AAChartView 内的方法有具体的介绍说明文章吗? #207
Comments
fun aa_updateChartWithOptions(
options: Any,
redraw: Boolean
) {
val isAAOptionsClass = options is AAOptions
val finalOptionsMapStr: String
if (isAAOptionsClass) {
val aaOptionsMapStr = Gson().toJson(options)
finalOptionsMapStr = aaOptionsMapStr
} else {
var classNameStr = options.javaClass.simpleName
classNameStr = classNameStr.replace("AA", "")
//convert fist character to be lowercase string
val firstChar = classNameStr.substring(0, 1)
val lowercaseFirstStr = firstChar.toLowerCase(Locale.ROOT)
classNameStr = classNameStr.substring(1)
val finalClassName = lowercaseFirstStr + classNameStr
val finalOptionsMap = HashMap<String, Any>()
finalOptionsMap[finalClassName] = options
val optionsStr = Gson().toJson(finalOptionsMap)
finalOptionsMapStr = optionsStr
}
val javaScriptStr = "updateChart('$finalOptionsMapStr','$redraw')"
safeEvaluateJavaScriptString(javaScriptStr)
} 从上面的 对应的 Highcharts 在线 demo 如下: |
fun aa_onlyRefreshTheChartDataWithChartOptionsSeriesArray(
seriesElementsArr: Array<AASeriesElement>,
animation: Boolean
) {
val seriesArr = Gson().toJson(seriesElementsArr)
val javaScriptStr = "onlyRefreshTheChartDataWithSeries('$seriesArr','$animation')"
safeEvaluateJavaScriptString(javaScriptStr)
}
|
如果想要动态更新图表的某一个或者多个属性(非数据)的话, 适合用
如果只是想要专门更新图表数据的话, 适合用
|
但是如你所说, 你的曲线图表更新频率很快. 由于 |
我需要跟新的数据就两个,一个是曲线值Y坐标值,一个是X坐标值,快速的追加最后一条而已,原来的方法存在先缩小绘制完成在放大过程,然后在这个过程中就会有卡顿现场,我目前调整为使用第一次绘制方法(一次性绘制所有)就很快 |
AAChartView 源码方法没有说明介绍,比如不同情况应当使用哪个刷新,git上的刷新方法与源码不一致,当前使用aa_updateChartWithOptions刷新是会导致UI卡顿,我的曲线更新很快,曲线点在100-200之间,请问我应当怎么写比较好
The text was updated successfully, but these errors were encountered: