标签: linechart

Chart: Vertical line and string on X label

I am using WinForms to create a line chart. I have two related questions:

  1. How can I draw a vertical line on the chart?

    I have tried to draw a vertical line between two points at (0,0) and (0,5) using:

    chart1.Series["Pakistan"].Points.AddXY(0, 0);
    chart1.Series["Pakistan"].Points.AddXY(0, 5);
    
    Run Code Online (Sandbox Code Playgroud)

    However, I get an askew line from (0,0) to (1,5).

  2. How can I label this line with a string on the X axis?

c# forms charts linechart winforms

0
推荐指数
1
解决办法
5801
查看次数

0
推荐指数
1
解决办法
2044
查看次数

在 Morris.js 中是否可以更改一行中每个点的颜色?

我正在使用 Morris.js 绘制折线图。

是否可以在一行中更改每个点的颜色?

jquery charts linechart morris.js

0
推荐指数
1
解决办法
1493
查看次数

在 LineChart 上显示图像而不是圆圈

我创建了一个LineChart使用库 MPAndroidChart 并且一切正常。

现在我想要做的是为图表上的每个条目显示一个可绘制的(图像)而不是默认的圆圈。

我从 API 中尝试了很多选项,但没有运气。

谁能告诉我我该怎么做?

charts android linechart mpandroidchart

0
推荐指数
1
解决办法
1601
查看次数

JavaFX LineChart 动态改变图例颜色

我正在尝试动态更改图例的颜色,因此我的 css 类中没有任何线条和符号的样式。我可以动态更改图表中的所有线条和符号,但遗憾的是无法更改图例。他们保持默认状态。有没有办法动态地做到这一点?

所以,我尝试过:

1)

for (int index = 0; index < series.getData().size(); index++) {
    XYChart.Data dataPoint = series.getData().get(index);
    Node lineSymbol = dataPoint.getNode().lookup(".chart-legend");
    lineSymbol.setStyle("-fx-background-color: #00ff00, #000000; -fx-background-insets: 0, 2;\n" +
            "    -fx-background-radius: 3px;\n" +
            "    -fx-padding: 3px;");
}
Run Code Online (Sandbox Code Playgroud)

根据 caspian.css 和下面的链接问题,这应该可以工作,但它给了我NullPointerException因为无法找到 .chart-legend 即使它在那里。

2)

for (Node n : lineChart.getChildrenUnmodifiable())
{
    if (n instanceof Legend)
    {
        final Legend legend = (Legend) n;

        // remove the legend
        legend.getChildrenUnmodifiable().addListener(new ListChangeListener<Object>()
        {
            @Override
            public void onChanged(Change<?> arg0)
            {
                for (Node node : …
Run Code Online (Sandbox Code Playgroud)

java charts javafx linechart

0
推荐指数
1
解决办法
3518
查看次数

标签 统计

charts ×5

linechart ×5

android ×2

c# ×1

forms ×1

java ×1

javafx ×1

jquery ×1

morris.js ×1

mpandroidchart ×1

winforms ×1