MCPcopy Create free account
hub / github.com/antvis/F2Native / ChartGetPosition

Function ChartGetPosition

core/android/F2NativeJNI.cpp:243–254  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

241}
242
243static jdoubleArray ChartGetPosition(JNIEnv *env, jclass clazz, jlong chart, jstring itemData) {
244 xg::XChart *_chart = reinterpret_cast<xg::XChart *>(chart);
245
246 std::string itemDataStr = JavaStringToString(env, itemData);
247 nlohmann::json data = nlohmann::json::parse(itemDataStr, nullptr, false);
248 const util::Point point = _chart->GetPosition(data);
249
250 jdouble buf[] = {point.x, point.y};
251 jdoubleArray rst = env->NewDoubleArray(2);
252 env->SetDoubleArrayRegion(rst, 0, 2, &buf[0]);
253 return rst;
254}
255
256static jint ChartClear(JNIEnv *env, jclass clazz, jlong chart) {
257 xg::XChart *_chart = reinterpret_cast<xg::XChart *>(chart);

Callers

nothing calls this directly

Calls 3

JavaStringToStringFunction · 0.85
parseFunction · 0.85
GetPositionMethod · 0.45

Tested by

no test coverage detected