2

Good afternoon. I am the user that posted the "Bar chart from array of objects" in stackoverflow. I need an extra help.

What I need is that in my bar chart appear the xAxis with the values of key and after i sort the data this values as the chart lenght of the bars sort and reset too.

var dataset = {key: [1, 2, 3, 4, 5], value: [10,20,30,40,50]};

http://jsfiddle.net/3HL4a/81/

If you do not mind send me the jsfiddle updated.

Regards and one more time thanks.

9
  • You just do .data(dataset.value) instead of .data(dataset, key). Commented Dec 16, 2013 at 16:17
  • You can explain better I do not understand. Commented Dec 16, 2013 at 16:47
  • The example you've linked to has a line of code .data(dataset, key). Assuming that you save your data in a variable dataset you need to replace this line with .data(dataset.value). Commented Dec 16, 2013 at 16:49
  • I already change it and nothing happens. If you do not mind change the code in jsddle and past the link here. Thank you friend. Commented Dec 16, 2013 at 17:18
  • You also have to put in your data. Commented Dec 16, 2013 at 17:44

1 Answer 1

1

You need to reference dataset.value instead of dataset throughout your code and make according adjustments for how to access the data. Complete example here.

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

2 Comments

When I sor the data the X values are not correcta. And I need to put the values of dataset.key in the xAxis insted of the its index
It might be better to post a separate question about this.

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.