You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It seems that registerTheme is no longer available as an export from @antv/g2.
I am trying to create a stacked bar chart with a custom palette for bars:
const chart = new Chart({
container,
autoFit: true,
});
chart
.interval()
.data(data)
.theme({
// Merely an example to demonstrate that this is not applying.
category10: [
"red",
"red",
"red",
"red",
"red",
"red",
"red",
"red",
"red",
"red",
],
})
.encode("x", xAxis)
.encode("y", yAxis)
.encode("color", series)
.transform({ type: "stackY" })
.axis({
x: {
labelAutoHide: true,
labelAutoRotate: false,
},
})
.scale("color", { palette: "category10" })
.interaction("elementHighlight", { background: true })
.interaction("brushFilter", true);
chart
.render()
.then(() => {})
.catch(() => {});
The field category10 is not getting updated. Also, on calling chart.getTheme(), I'm seeing undefined. Something's clearly broken here.
Also, can you please update your documentation for theme customization? How do you even create a custom theme anymore if registerTheme no longer exissts? The docs are extremely outdated and reference v4 and not v5.
问题描述
It seems that
registerTheme
is no longer available as an export from@antv/g2
.I am trying to create a stacked bar chart with a custom palette for bars:
The field
category10
is not getting updated. Also, on callingchart.getTheme()
, I'm seeingundefined
. Something's clearly broken here.Also, can you please update your documentation for theme customization? How do you even create a custom theme anymore if
registerTheme
no longer exissts? The docs are extremely outdated and reference v4 and not v5.重现链接
https://codesandbox.io/p/sandbox/333923
重现步骤
Simply create a chart and try to customize the color palette. It will not get applied.
预期行为
As per the above example, all bars in the chart should appear red or whatever custom palette you provide.
平台
屏幕截图或视频(可选)
No response
补充说明(可选)
No response
The text was updated successfully, but these errors were encountered: