Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

change center of VueUiQuadrant graph #53

Answered by graphieros
elnerto asked this question in Q&A
Discussion options

Hello,
I love this library.
I wanted to know if I can move the axes in the VueUiQuadrant graph, so that the center is not at (0,0)
For example, the center is at (10,20)
to graph only positive values

Thank you very much and greetings to all

You must be logged in to vote

Hi @elnerto !
Thank you very much :)

The purpose of a quadrant chart is to position datapoints on 4 sides, to identify the quality of a datapoint, and have it classified on one of 4 sides.

The intersection of both axes is derived from the dataset, it is only 0,0 if extremes are inverse (-n , n). If all your datapoints are positive on both x and y, they are all classified in the same portion of the quadrant, that's what it's designed to do.

I think you might consider using VueUiScatter for your use case. The scatter chart's axes will behave as you expect.

Cheers, and thanks for trying out the lib :)

Replies: 2 comments 1 reply

Comment options

Hi @elnerto !
Thank you very much :)

The purpose of a quadrant chart is to position datapoints on 4 sides, to identify the quality of a datapoint, and have it classified on one of 4 sides.

The intersection of both axes is derived from the dataset, it is only 0,0 if extremes are inverse (-n , n). If all your datapoints are positive on both x and y, they are all classified in the same portion of the quadrant, that's what it's designed to do.

I think you might consider using VueUiScatter for your use case. The scatter chart's axes will behave as you expect.

Cheers, and thanks for trying out the lib :)

You must be logged in to vote
0 replies
Answer selected by graphieros
Comment options

Thank you,
Instead of modifying the axes, offset the XY data,
add the true data MyDataX, MyDataY and modify the custom tooltip
to show them to the user

I love this quadrant graph
Thanks a lot

customFormat: ({ seriesIndex, datapoint, series, config }) => {
const content = "My custom content";
return <div><span id="Q" >Quantity sold</span> <span id="$" >${datapoint.MyDataX}</span></div><div><span id="Q" >Sales amount</span> <span id="$" >${datapoint.MyDataY}</span></div>
}
...
"series": [
{
"name": "IBM",
"MyDataX": 3300,
"MyDataY": 30000,
"x": -2,
"y": -1
}

You must be logged in to vote
1 reply
Comment options

Very cool workaround !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
side question Further information is requested

AltStyle によって変換されたページ (->オリジナル) /