]>
git.proxmox.com Git - ceph.git/blob - ceph/src/boost/libs/hana/doc/js/chart.js
1 // Copyright Louis Dionne 2013-2016
2 // Distributed under the Boost Software License, Version 1.0.
3 // (See accompanying file LICENSE.md or copy at http://boost.org/LICENSE_1_0.txt)
9 Hana
.initChart = function(div
, options
) {
10 if (options
.xAxis
== undefined) {
12 title
: { text
: "Number of elements" },
17 if (options
.yAxis
== undefined) {
19 title
: { text
: "Time (s)" },
24 if (options
.subtitle
== undefined) {
25 options
.subtitle
= { text
: "(smaller is better)" };
28 if (options
.chart
== undefined) {
29 options
.chart
= { zoomType
: 'xy' };
32 options
.plotOptions
= options
.plotOptions
|| {};
33 options
.plotOptions
.series
= options
.plotOptions
.series
|| {};
34 options
.plotOptions
.series
.marker
= options
.plotOptions
.series
.marker
|| { enabled
: false };
36 if (options
.title
.x
== undefined) {
37 options
.title
.x
= -20; // center
40 if (options
.series
.stickyTracking
== undefined) {
41 options
.series
.stickyTracking
= false;
44 // Fix the colors so that a series has the same color on all the charts.
45 // Based on the colors at http://api.highcharts.com/highcharts#colors.
47 'hana::tuple': '#f45b5b'
48 , 'hana::basic_tuple': '#434348'
49 , 'mpl::vector': '#90ed7d'
50 , 'std::array': '#8085e9'
51 , 'fusion::vector': '#f7a35c'
52 , 'std::vector: ': '#f15c80'
53 , 'std::tuple': '#e4d354'
54 , 'hana::set': '#2b908f'
55 , 'hana::map': '#7cb5ec'
56 , 'fusion::list': '#91e8e1'
58 options
.series
.forEach(function(series
) {
59 if (colorMap
[series
.name
])
60 series
.color
= colorMap
[series
.name
];
63 options
.tooltip
= options
.tooltip
|| {};
64 options
.tooltip
.valueSuffix
= options
.tooltip
.valueSuffix
|| 's';
66 if (options
.legend
== undefined) {
70 verticalAlign
: 'middle',
74 div
.highcharts(options
);