1

I need to visualize the bar chart with Javascript. So I'm used C3 JS to visualize the chart. Simply I'm using this Bar chart as follows,

<div id="chart"></div>

<script>

var chart = c3.generate({
    bindto: '#chart',
    data: {
      columns: [
        ['data1', 30, 200, 100, 400, 150, 250],
        ['data2', 50, 20, 10, 40, 15, 25]
      ],
      axes: {
        data2: 'y2'
      },
      types: {
        data2: 'bar'
      }
    },
    axis: {
      y: {
        label: {
          text: 'Y Label',
          position: 'outer-middle'
        },
        tick: {
          format: d3.format("$,") // ADD
        }
      },
      y2: {
        show: true,
        label: {
          text: 'Y2 Label',
          position: 'outer-middle'
        }
      }
    }
});

</script>

enter image description here

But the problem is when X-axis consists of the large data set Chart getting cramped. I have more than 700 data.

enter image description here

Have any possible way to avoid this? can I add scroll bar between primary and secondary X-axis?

1 Answer 1

1

Google, such a wonderfull thing ;)

https://c3js.org/samples/interaction_zoom.html

or this

C3 / D3 bar chart with horizontal scroll

Sign up to request clarification or add additional context in comments.

1 Comment

your welcome. thanks to you I know now a great alternative to flot... :)

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.