Chartist-js: Height of gauge chart

Created on 15 Apr 2015  路  4Comments  路  Source: gionkunz/chartist-js

I am displaying a gauge chart in my app as the demo shows:
screen shot 2015-04-15 at 14 32 31

But the problem is that the div around is almost twice as long compared to the actual chart. So any element that I am putting directly below the chart feels very disconnected and like it does not belong to the chart. I tried to play around with the available class names (such as ct-golden-section, etc) but haven;t had that much luck.

Is there any way to draw a gauge chart where the surrounding div is more or less as long as the chart itself?

bug

Most helpful comment

In case anyone wants a live demo on how to fix this: http://codepen.io/EvanWieland/pen/bpjrog. This solution also maintains proper chart height during browser resize thanks to the created event.

All 4 comments

Also, and I can file this as a separate bug, it seems the gauge chart does not support the meta tag. So series: [ {meta: 'test, value: 100}, { meta: 'test-2', value: 200 }] fails, where-as series: [100, 200] works fine.

Would be great if all charts would support the meta tag.

Hmmm.. I was under the impression this works. But it looks like meta is not written in the pie chart. Let's fix this asap.

In regards to the unused space of the donut chart, I think this isn't nice too but the donut was just a simple extension of the pie and it's not perfect. There are ways around this using negative margin on the bottom of the container, but I know it's not perfect. We should re-consider how we align the pie chart on the canvas maybe in relation to #263

In case anyone wants a live demo on how to fix this: http://codepen.io/EvanWieland/pen/bpjrog. This solution also maintains proper chart height during browser resize thanks to the created event.

Was this page helpful?
0 / 5 - 0 ratings