Skip to content
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

Android版本中,可滚动的图表且添加值域分割颜色线,折线只绘制了部分,虽然点击可以看到有数据,但线段没有绘制出来 #137

Open
chugengdu opened this issue May 4, 2022 · 2 comments
Labels
help wanted Extra attention is needed

Comments

@chugengdu
Copy link

chugengdu commented May 4, 2022

void setUpAAPlotLinesChartView() {
        AAChartView aaChartView = findViewById(R.id.aa_chart_view);
        AASeriesElement[] configurePlotLinesChartSeriesArray = configurePlotLinesChartSeriesArray();

        AAChartModel aaChartModel = new AAChartModel()
                .chartType(AAChartType.Line)
                .title("流式荧光检测")
                .subtitle("实验数据")
                .backgroundColor("#ffffff")
                .categories(new String[]{})
                .dataLabelsEnabled(false)
                .yAxisGridLineWidth(0f)
                .yAxisTitle("电压值(V)")
                .zoomType(AAChartZoomType.X)
                .scrollablePlotArea(new AAScrollablePlotArea()
                        .minWidth(8000)
                        .scrollPositionX(0f))
                .series(configurePlotLinesChartSeriesArray);




        AAPlotLinesElement[] aaPlotLinesElementsArr = {
                new AAPlotLinesElement()
                        .color("#1e90ff")//颜色值(16进制)
                        .dashStyle(AAChartLineDashStyleType.LongDashDotDot)//样式:Dash,Dot,Solid等,默认Solid
                        .width((1f)) //标示线粗细
                        .value((1.4f)) //所在位置
                        .zIndex((1)) //层叠,标示线在图表中显示的层叠级别,值越大,显示越向前
                        .label(new AALabel()
                        .useHTML(true)
                        .text("分割线1")
                        .style(new AAStyle()
                                .color("#FFD700")
                                .backgroundColor("black")
                                .borderRadius(5)
                                .border("3px solid #000000")
                                .opacity(1.0)
                                .fontWeight(AAChartFontWeightType.Bold)
                        )
                )
                ,
                new AAPlotLinesElement()
                        .color("#ef476f")//颜色值(16进制)
                        .dashStyle(AAChartLineDashStyleType.LongDashDot)//样式:Dash,Dot,Solid等,默认Solid
                        .width((1f)) //标示线粗细
                        .value((2.2f)) //所在位置
                        .zIndex((1)) //层叠,标示线在图表中显示的层叠级别,值越大,显示越向前
                        .label(new AALabel()
                        .useHTML(true)
                        .text("分割线2")
                        .style(new AAStyle()
                                .color("red")
                                .backgroundColor("black")
                                .borderRadius(5)
                                .border("3px solid red")
                                .opacity(1.0)
                                .fontWeight(AAChartFontWeightType.Bold)))
        };

        AAOptions aaOptions = AAOptionsConstructor.INSTANCE.configureChartOptions(aaChartModel);
        AAYAxis aaYAxis = aaOptions.getYAxis();

        assert aaYAxis != null;
        aaYAxis.plotLines(aaPlotLinesElementsArr);

        aaChartView.aa_drawChartWithChartOptions(aaOptions);
//        aaChartView.aa_drawChartWithChartModel(aaChartModel);
    }

    private AASeriesElement[] configurePlotLinesChartSeriesArray() {
        Map map1 = new HashMap();
        map1.put("value", 1.4);
        map1.put("color", "#1e90ff");
        Map map2 = new HashMap();
        map2.put("value", 2.2);
        map2.put("color", "#ef476f");
        Map map3 = new HashMap();
        map3.put("color", "#ffd066");
        Map[] zonesArr = new Map[]{map1, map2, map3};
        return new AASeriesElement[]{
                new AASeriesElement()
                        .name("第一次数据")
                        .data(InputFileReader.toArrayByInputStreamReader(this, R.raw.b))
//                        .fillOpacity(0.5f)
//                        .lineWidth(2f)
                        .zones(zonesArr)
        };
    }

上面是我的代码,下面是运行的截图
Screenshot_20220504_194248
InputFileReader.toArrayByInputStreamReader(this, R.raw.b)函数是读取我本地的txt处理后返回double数组

求帮助!

@AAChartModel
Copy link
Owner

尴尬了, 这貌似是 Highcharts 自身的一个 bug, 官方至今也没有及时修复.

参考Highcharts 官方仓库的这个相同问题:

@AAChartModel
Copy link
Owner

AAChartModel commented May 4, 2022

Run the demo: https://jsfiddle.net/BlackLabel/f91Lam5b/show (iOS 14+ and Chrome (86.0.4240.93) browser)

看官方回复, iOS 14 + and Chrome (86.0.4240.93) 应该都有这个问题. 我提了这个问题已经两年了, 也没有解决 🤷🏻‍♀️

@AAChartModel AAChartModel added the help wanted Extra attention is needed label Jul 25, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants