| 241 | } |
| 242 | |
| 243 | static 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 | |
| 256 | static jint ChartClear(JNIEnv *env, jclass clazz, jlong chart) { |
| 257 | xg::XChart *_chart = reinterpret_cast<xg::XChart *>(chart); |
nothing calls this directly
no test coverage detected