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
I'm trying to use a custom symbol, like a rounded square, in the legend for a donut chart that I'm creating. I've been trying to do this through a combination of the legend.usePoint and point.pattern settings. However, I've found that while custom symbol will show up in the legend as expected if the chart type is line, if I switch the chart type to donut it no longer displays.
Steps to check or reproduce
var chart = bb.generate({
data: {
columns: [
["data1", 30, 200, 100, 400, 150, 250],
["data2", 130, 100, 200, 100, 250, 150],
],
type: "line", // Switch this to donut and the symbol won't display in the legend
},
point: {
pattern: [
'<rect width="15" height="15" rx="5" ry="5" ></rect>',
]
},
legend: {
usePoint: true,
position: 'inset'
},
bindto: "#usePoint"
});
I inspected the html for the chart and I found that the symbols in the legend are set with a tag that has an href pointing to the symbol which exists somewhere else in the page. When I inspected the html with the chart type set to donut, the href is still there, but the element it is referencing does not seem to exist.
Line chart html:
Donut chart html
The text was updated successfully, but these errors were encountered:
Hi @jarrod-cummings, basically custom point defined via point.pattern is an option dedicated to be used for axis based charts. It doesn't work on Arc based chart for that reason.
Let me consider if this approach is generally useful or not.
netil
pushed a commit
to netil/billboard.js
that referenced
this issue
Feb 22, 2024
Description
I'm trying to use a custom symbol, like a rounded square, in the legend for a donut chart that I'm creating. I've been trying to do this through a combination of the legend.usePoint and point.pattern settings. However, I've found that while custom symbol will show up in the legend as expected if the chart type is line, if I switch the chart type to donut it no longer displays.
Steps to check or reproduce
I inspected the html for the chart and I found that the symbols in the legend are set with a tag that has an href pointing to the symbol which exists somewhere else in the page. When I inspected the html with the chart type set to donut, the href is still there, but the element it is referencing does not seem to exist.
Line chart html:
Donut chart html
The text was updated successfully, but these errors were encountered: