1

enter image description here

I want to display four lines on a line chart using react-native-gifted-chart. Specifically, I need to show two lines using primary data (data, data1) and two lines using secondary data(secondaryData) because the labels for the primary and secondary datasets will be different. However, when I attempted this, I couldn't get the values from data2 to appear on the graph if I used secondaryData. Please help Thanks

1 Answer 1

2

You can use the dataSet prop instead of data. The dataSet will be an array of 4 objects representing the 4 lines. So you will not need to use data1, data2 or secondaryData.

In the dataSet array, add the property isSecondary: true to the two sets which you want to make secondary.

I have also replied to the issue you raised on the Github repo- How to create 4 line graph 2 with primary and 2 with secondary data

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

Comments

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.