APEX图表 - 如何定位和样式一个特定的网格线?

发布于 2025-01-24 20:29:43 字数 234 浏览 7 评论 0原文

是否有人知道如何像示例中的特定网格线和样式? 我知道如何与:

grid: {
          strokeDashArray: 10,
        },

但是如何根据tick值瞄准网格线? 所需结果

Does anyone has clue how to target specific grid line and style like in the example?
I know how to dash line with:

grid: {
          strokeDashArray: 10,
        },

But how can I target grid line according to the tick value?
Desired result

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(2

舂唻埖巳落 2025-01-31 20:29:43

您可以做到的唯一方法是通过CSS

.apexcharts-gridline:nth-child(2) {
  stroke-dasharray: 10;
}

或使用注释,而是 https://papexcharts.com/docs/annotations/annotations/

Only way you can do it is via css

.apexcharts-gridline:nth-child(2) {
  stroke-dasharray: 10;
}

Or use annotations instead https://apexcharts.com/docs/annotations/

南笙 2025-01-31 20:29:43

我已经使用注释属性对其进行了排序。这是一个示例:

// Breakdown line 
        annotations: {
            position: 'front',
            yaxis: [
                {
                    y: 3000,
                    strokeDashArray: 5,
                    label: {
                        position: 'left',
                        borderColor: 'transparent',
                        textAnchor: 'middle',
                        offsetY: -10,
                        offsetX: 50,
                        style: {
                            color: '#D0D4D9',
                            background: "transparent",
                        },
                        text: ''
                    }
                }
            ]
        }

I have sorted it by using annotations property. Here is an example:

// Breakdown line 
        annotations: {
            position: 'front',
            yaxis: [
                {
                    y: 3000,
                    strokeDashArray: 5,
                    label: {
                        position: 'left',
                        borderColor: 'transparent',
                        textAnchor: 'middle',
                        offsetY: -10,
                        offsetX: 50,
                        style: {
                            color: '#D0D4D9',
                            background: "transparent",
                        },
                        text: ''
                    }
                }
            ]
        }
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文