Charts and Graphs¶
Datagrepper provides a wide-array of charts in SVG format that you can use to visualize message history in your blog, website, or application.
Usage¶
You simply include an <img>
tag with the src
pointed at the charts URL, like this:
<html>
<body>
<h1>My Site</h1>
<p class="lead">Welcome to my site.</p>
<p>Here is a comparison of activity on the kernel, dracut, and systemd packages:</p>
<img src="https://apps.fedoraproject.org/datagrepper/charts/line?package=kernel&package=systemd&package=dracut&split_on=packages"/>
<footer>Happy Hacking!</footer>
</body>
</html>
Options¶
There are lots of options.
First, you can specify all the same options that you would to “search” queries.
The the documentation on the main page for more information about those. You
can filter by user
, package
, category
, and topic
(as well as
not_user
, not_package
, etc..).
Per User¶
Using a url like charts/line?user=remi
will give you a chart like this:
Per Package¶
Or you could produce graphs specific to a package with a url like charts/line?package=nethack
:
Per Category¶
Following along the same theme, you could limit your graph to only
displaying the count of messages from a particular subsystem. For
instance, the graph at charts/line?category=buildsys
shows the trend
of activity in the koji build system:
Combining all that¶
Just like with normal queries to the JSON API, you can combine query
types like showing only koji messages for the kernel, dracut, and systemd
packages with
charts/line?package=kernel&package=dracut&package=systemd&category=buildsys
:
Chart Types¶
So far you have only seen the charts/line
URL, but there are many
others. Choose from any of these:
line
stackedline
xy
bar
horizontalbar
stackedbar
horizontalstackedbar
funnel
pyramid
verticalpyramid
dot
gauge
For example, here is charts/bar?category=wiki
:
Styles¶
All the graphs above have been in the default
style, but you can specifify different ones:
The full list is:
blue
turquoise
neon
dark_green
dark_solarized
dark_green_blue
dark_colorized
default
light
light_colorized
light_solarized
green
clean
light_red_blue
Check it out.. here’s charts/horizontalbar?category=fedoratagger&style=light_solarized
:
Splitting Series¶
In the kernel/dracut/systemd example above, it might be nice to split those out
into independent series. You can do that with the split_on
parameter.
charts/line?package=kernel&package=dracut&package=systemd&split_on=packages
:
You can also split on multiple kinds of factors at once:
Other options¶
title
, Set a title on the plot.
N
, (int), the number of data points in the graph (the resolution of the x-axis).
width
, (int), Defaults to800
. Sets the width of the plot in pixels.height
, (int), Defaults to600
. Sets the height of the plot in pixels.interpolation
, (boolean), Defaults toNone
. You can also pass itcubic
orquadratic
.
human_readable
, (boolean), Defaults toTrue
. Converts numbers to nicer-to-read numbers.
logarithmic
, (boolean), Defaults toFalse
. Logarithmically scales the y-axis.
show_x_labels
, (boolean), Defaults toTrue
. Show/hide the x-axis labels.show_y_labels
, (boolean), Defaults toTrue
. Show/hide the y-ayis labels.
show_dots
, (boolean), Defaults toTrue
. Show/hide the datapoints.
fill
, (boolean), Defaults toFalse
. Fill the area under curves in line plots.