billboard.js

Billboardjs chart bigger than it's container

十年热恋 提交于 2019-12-11 18:14:07
问题 When generating a billboard chart and not providing a size, sometime the resulting svg is bigger than the container. Is there a way to make sure the svg size is always within bounds? That is, without providing size in the generation config. var chart = bb.generate({ bindto: "#chart", data: { columns: [ ["data1", 130, 200, 100, 170, 150, 250], ["data2", 130, 100, 140, 35, 110, 50] ], types: { data1: "line", data2: "area-spline" }, colors: { data1: "red", data2: "green" } } }); setTimeout(() =>

Is it possible to show a message text on the chart of Billboard.js?

旧巷老猫 提交于 2019-12-11 15:27:02
问题 I'm working with Biilboard.js, a library which is based on D3. I created a chart and I want to be able to show a message on it, for example if Y-axis is greater than 100 or anything like this, doesn't matter the condition. This is an example of what I want which is done with pure D3 (I guess): Basically, if that condition is fulfilled, that message box appears over the chart. Do you have any ideas of to do this? 回答1: There're several ways to do that. 1) Add y Axis grid text 2) Simply, add

How to use more complex svg as chart point in billboard.js?

北城余情 提交于 2019-12-11 06:47:26
问题 I'm trying to use some custom points for a billboard chart. I can use a <path> element and it will be rendered as the data points. What I want to do is to use some points that may be a grouping of svg elements, so I'm trying to use a <g> or <svg> with some elements inside those. From what I can see, the chart <defs> only contains the g/svg wrapper, and none of the elements the g/svg contains. Is there a way to make this work? So to have the entire g/svg element rendered ? In the example below