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

Possibility to scale series #82

Open
Mickael-Martin opened this issue Aug 25, 2023 · 8 comments
Open

Possibility to scale series #82

Mickael-Martin opened this issue Aug 25, 2023 · 8 comments
Assignees

Comments

@Mickael-Martin
Copy link

hello,

I search a way to transform/scale one or more series to obtain graph like that :

BrsOZzaCQAAyqBZ

mailstat-daily

I don't find any option to make that.

@goat1000
Copy link
Owner

I'm sorry, I don't understand what you are trying to do. The examples you gave look like line graphs with negative values.

@Mickael-Martin
Copy link
Author

Mickael-Martin commented Aug 28, 2023

Hello,

No, it's positive values on Y negative axis. You can see legends in the second example, all values are positive. This feature is usefull to display bandwidth, for example :

image

@goat1000
Copy link
Owner

The easiest way to do that is to pre-process the values you pass to SVGGraph, and multiply all the values you want to be negative by -1.

// make series at array positions 3 and 4 negative
$negative_index = [3, 4];

foreach($values as $key => $row) {
  foreach($negative_index as $index) {
    $values[$key][$index] = $row[$index] * -1;
  }
}

@Mickael-Martin
Copy link
Author

Mickael-Martin commented Aug 28, 2023

Yes, I know that, but you got wrong values. The idea is an additional Y axis inverted like grafana/grafana#38202 / grafana/grafana#44774

@goat1000
Copy link
Owner

OK, I'll add it to the list of things to look at.

@goat1000 goat1000 self-assigned this Aug 28, 2023
@Mickael-Martin
Copy link
Author

Thank you very much : I want to use that to extend Zabbix widget (svggraph widget use your project, do you know ?) to get beautiful graphs for bandwidth.

@goat1000
Copy link
Owner

Are you sure that Zabbix uses SVGGraph? I can't see anything about it.

@Mickael-Martin
Copy link
Author

Oh no, I was very wrong. I have skimmed through the PHP classes and linked to your project. I'm really sorry for this blunder...
And the worst part is that two of us made the connection (with a colleague)... So you can close this "issue" if you like.
I am frankly ashamed.

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

2 participants