Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not starting at zero #18

Closed
magarrent opened this issue Apr 28, 2021 · 8 comments
Closed

Not starting at zero #18

magarrent opened this issue Apr 28, 2021 · 8 comments
Assignees

Comments

@magarrent
Copy link

Hello mates!

See my issue here.

I've created this chart with this rang:

[10000, 12000, 14000, 16000, 18000]

The issue here is that the charts doesn't beggins with zero value, and appears like this:

image

I supose that the chart is beggining with 0, and that is the reason, but, how can I solve this?

Thx!

@majazdl
Copy link

majazdl commented May 4, 2021

Hello!
This is my question too!
I want to set starting value to different value (not 0).
Thank you :)

@haiiaaa
Copy link
Owner

haiiaaa commented May 4, 2021

I have some code for this already that uses dataset.minValue

datasets: [{
    value: 12500,
    minValue: 10000, // instead of zero
    data: [12000, 14000, 16000, 18000], // does not include zero/minValue
    backgroundColor: ['green', 'yellow', 'orange', 'red'],
}]

Another option would be to use the first data point as zero/min-value with some flag

datasets: [{
    value: 12500,
    includesMin: true,
    data: [10000, 12000, 14000, 16000, 18000],
    backgroundColor: [null, 'green', 'yellow', 'orange', 'red'], // must include null unless removing minValue from data
}]

What do you think?

@majazdl
Copy link

majazdl commented May 4, 2021

Hello
Good to see you :)
Unfortunately, yours didn't work!
This the code :

 datasets: [{
                        data: [162,234,306,378,450],
                        value: 100,
                        includesMin: true,
                        min: 90,
                        backgroundColor: [ 'red', 'orange' , 'yellow' , 'blue' , 'green'],
                        borderWidth: 2
                    }]

I tried 2 ways but still same.

@haiiaaa
Copy link
Owner

haiiaaa commented May 4, 2021

I have not pushed any code or published any new release yet.

@majazdl
Copy link

majazdl commented May 4, 2021

I'll waiting for new release sir
It's important for me (starting value)

Best Regards

@magarrent
Copy link
Author

I have some code for this already that uses dataset.minValue

datasets: [{
    value: 12500,
    minValue: 10000, // instead of zero
    data: [12000, 14000, 16000, 18000], // does not include zero/minValue
    backgroundColor: ['green', 'yellow', 'orange', 'red'],
}]

Another option would be to use the first data point as zero/min-value with some flag

datasets: [{
    value: 12500,
    includesMin: true,
    data: [10000, 12000, 14000, 16000, 18000],
    backgroundColor: [null, 'green', 'yellow', 'orange', 'red'], // must include null unless removing minValue from data
}]

What do you think?

Hi @haiiaaa !

I think minValue: 10000, // instead of zero it's more intuitive

@haiiaaa haiiaaa self-assigned this May 4, 2021
@majazdl
Copy link

majazdl commented May 4, 2021

I have some code for this already that uses dataset.minValue

datasets: [{
    value: 12500,
    minValue: 10000, // instead of zero
    data: [12000, 14000, 16000, 18000], // does not include zero/minValue
    backgroundColor: ['green', 'yellow', 'orange', 'red'],
}]

Another option would be to use the first data point as zero/min-value with some flag

datasets: [{
    value: 12500,
    includesMin: true,
    data: [10000, 12000, 14000, 16000, 18000],
    backgroundColor: [null, 'green', 'yellow', 'orange', 'red'], // must include null unless removing minValue from data
}]

What do you think?

Hi @haiiaaa !

I think minValue: 10000, // instead of zero it's more intuitive

Is it work for you ?!

@magarrent
Copy link
Author

@majazdl @haiiaaa is working on it, I supose that it's not available yet

haiiaaa pushed a commit that referenced this issue May 5, 2021
Version 0.3.0
@haiiaaa haiiaaa closed this as completed May 5, 2021
@haiiaaa haiiaaa mentioned this issue May 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants