playbook_ui 15.8.0.pre.rc.1 → 16.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/app/pb_kits/playbook/_playbook.scss +0 -4
- data/app/pb_kits/playbook/pb_pb_bar_graph/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_circle_chart/pb_circle_chart.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_gauge_chart/pb_gauge_chart.test.jsx +1 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/docs/_description.md +6 -1
- data/app/pb_kits/playbook/pb_pb_line_graph/pb_line_graph.test.jsx +1 -1
- data/app/pb_kits/playbook/utilities/test/globalProps/alignContent.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/alignItems.test.js +38 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/alignSelf.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/display.test.js +37 -51
- data/app/pb_kits/playbook/utilities/test/globalProps/flex.test.js +44 -76
- data/app/pb_kits/playbook/utilities/test/globalProps/flexDirection.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/flexGrow.test.js +35 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/flexShrink.test.js +35 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/flexWrap.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/globalPropsTestHelper.js +373 -0
- data/app/pb_kits/playbook/utilities/test/globalProps/justifyContent.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/justifySelf.test.js +37 -50
- data/app/pb_kits/playbook/utilities/test/globalProps/order.test.js +36 -48
- data/app/pb_kits/playbook/utilities/test/globalProps/truncate.test.js +30 -18
- data/dist/chunks/_pb_line_graph-ByQFYuFO.js +1 -0
- data/dist/chunks/_typeahead-Bl8_gWmz.js +1 -0
- data/dist/chunks/componentRegistry-DzmmLR2x.js +1 -0
- data/dist/chunks/globalProps-D6R2eJnp.js +6 -0
- data/dist/chunks/lib-C8h70OzX.js +29 -0
- data/dist/chunks/vendor.js +4 -4
- data/dist/menu.yml +0 -29
- data/dist/playbook-rails-react-bindings.js +1 -1
- data/dist/playbook-rails.js +1 -1
- data/dist/playbook.css +1 -1
- data/lib/playbook/version.rb +1 -1
- metadata +8 -147
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.scss +0 -6
- data/app/pb_kits/playbook/pb_bar_graph/_bar_graph.tsx +0 -196
- data/app/pb_kits/playbook/pb_bar_graph/barGraph.test.js +0 -31
- data/app/pb_kits/playbook/pb_bar_graph/barGraphSettings.js +0 -32
- data/app/pb_kits/playbook/pb_bar_graph/barGraphTheme.ts +0 -106
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/bar_graph.rb +0 -98
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_colors.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.html.erb +0 -42
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_custom_rails.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_default.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.jsx +0 -69
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.html.erb +0 -58
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_horizontal.jsx +0 -64
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.html.erb +0 -14
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend.jsx +0 -40
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.html.erb +0 -15
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_non_clickable.jsx +0 -48
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.html.erb +0 -62
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.jsx +0 -136
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_legend_position.md +0 -17
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.html.erb +0 -23
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_negative_numbers.jsx +0 -52
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.html.erb +0 -26
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.jsx +0 -86
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_secondary_y_axis.md +0 -3
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.html.erb +0 -20
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.jsx +0 -46
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_spline.md +0 -2
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.html.erb +0 -22
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.jsx +0 -55
- data/app/pb_kits/playbook/pb_bar_graph/docs/_bar_graph_stacked.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_bar_graph/docs/example.yml +0 -28
- data/app/pb_kits/playbook/pb_bar_graph/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_circle_chart/ChartsTypes.ts +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.scss +0 -16
- data/app/pb_kits/playbook/pb_circle_chart/_circle_chart.tsx +0 -228
- data/app/pb_kits/playbook/pb_circle_chart/circleChart.test.js +0 -45
- data/app/pb_kits/playbook/pb_circle_chart/circleChartTheme.ts +0 -88
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.html.erb +0 -10
- data/app/pb_kits/playbook/pb_circle_chart/circle_chart.rb +0 -99
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.html.erb +0 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_block.jsx +0 -88
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.html.erb +0 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors.jsx +0 -44
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.html.erb +0 -20
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.jsx +0 -43
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_custom_tooltip.md +0 -5
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.html.erb +0 -19
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_default.jsx +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.html.erb +0 -136
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_inner_sizes.jsx +0 -152
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.html.erb +0 -86
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.jsx +0 -142
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_live_data.jsx +0 -63
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.html.erb +0 -22
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_rounded.jsx +0 -45
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.html.erb +0 -37
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_labels.jsx +0 -61
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.html.erb +0 -22
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_legend_kit.jsx +0 -41
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.html.erb +0 -38
- data/app/pb_kits/playbook/pb_circle_chart/docs/_circle_chart_with_title.jsx +0 -55
- data/app/pb_kits/playbook/pb_circle_chart/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_circle_chart/docs/example.yml +0 -26
- data/app/pb_kits/playbook/pb_circle_chart/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_dashboard/commonSettings.js +0 -104
- data/app/pb_kits/playbook/pb_dashboard/pbChartsColorsHelper.ts +0 -16
- data/app/pb_kits/playbook/pb_dashboard/pbChartsDarkTheme.ts +0 -174
- data/app/pb_kits/playbook/pb_dashboard/pbChartsLightTheme.ts +0 -173
- data/app/pb_kits/playbook/pb_dashboard/themeTypes.ts +0 -20
- data/app/pb_kits/playbook/pb_gauge/_gauge.scss +0 -49
- data/app/pb_kits/playbook/pb_gauge/_gauge.tsx +0 -215
- data/app/pb_kits/playbook/pb_gauge/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors.jsx +0 -36
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_colors_react.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.html.erb +0 -32
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex.jsx +0 -146
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_rails.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_complex_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.html.erb +0 -11
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_default.jsx +0 -30
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.html.erb +0 -12
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_disable_animation.jsx +0 -36
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_full_circle.jsx +0 -49
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_height.jsx +0 -62
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_live_data.jsx +0 -76
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.html.erb +0 -15
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.jsx +0 -54
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_min_max.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.html.erb +0 -27
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.jsx +0 -80
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_sizing.md +0 -2
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.html.erb +0 -14
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_title.jsx +0 -38
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.html.erb +0 -29
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units.jsx +0 -72
- data/app/pb_kits/playbook/pb_gauge/docs/_gauge_units_react.md +0 -1
- data/app/pb_kits/playbook/pb_gauge/docs/example.yml +0 -27
- data/app/pb_kits/playbook/pb_gauge/docs/index.js +0 -11
- data/app/pb_kits/playbook/pb_gauge/gauge.html.erb +0 -2
- data/app/pb_kits/playbook/pb_gauge/gauge.rb +0 -56
- data/app/pb_kits/playbook/pb_gauge/gauge.test.js +0 -35
- data/app/pb_kits/playbook/pb_gauge/gaugeTheme.ts +0 -91
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.scss +0 -3
- data/app/pb_kits/playbook/pb_line_graph/_line_graph.tsx +0 -166
- data/app/pb_kits/playbook/pb_line_graph/docs/_description.md +0 -1
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors.jsx +0 -56
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_rails.md +0 -2
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_colors_react.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_default.jsx +0 -52
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.html.erb +0 -26
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.jsx +0 -70
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_height.md +0 -3
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.html.erb +0 -15
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend.jsx +0 -43
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.html.erb +0 -16
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_nonclickable.jsx +0 -49
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.html.erb +0 -62
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.jsx +0 -129
- data/app/pb_kits/playbook/pb_line_graph/docs/_line_graph_legend_position.md +0 -14
- data/app/pb_kits/playbook/pb_line_graph/docs/example.yml +0 -18
- data/app/pb_kits/playbook/pb_line_graph/docs/index.js +0 -6
- data/app/pb_kits/playbook/pb_line_graph/lineGraph.test.js +0 -52
- data/app/pb_kits/playbook/pb_line_graph/lineGraphSettings.js +0 -30
- data/app/pb_kits/playbook/pb_line_graph/lineGraphTheme.ts +0 -125
- data/app/pb_kits/playbook/pb_line_graph/line_graph.html.erb +0 -1
- data/app/pb_kits/playbook/pb_line_graph/line_graph.rb +0 -93
- data/dist/chunks/_typeahead-D0GNUBXn.js +0 -6
- data/dist/chunks/lib-DxCgrqqG.js +0 -29
|
@@ -1,11 +0,0 @@
|
|
|
1
|
-
export { default as GaugeDefault } from './_gauge_default.jsx'
|
|
2
|
-
export { default as GaugeDisableAnimation } from './_gauge_disable_animation.jsx'
|
|
3
|
-
export { default as GaugeFullCircle } from './_gauge_full_circle.jsx'
|
|
4
|
-
export { default as GaugeHeight } from './_gauge_height.jsx'
|
|
5
|
-
export { default as GaugeMinMax } from './_gauge_min_max.jsx'
|
|
6
|
-
export { default as GaugeSizing } from './_gauge_sizing.jsx'
|
|
7
|
-
export { default as GaugeTitle } from './_gauge_title.jsx'
|
|
8
|
-
export { default as GaugeUnits } from './_gauge_units.jsx'
|
|
9
|
-
export { default as GaugeLiveData } from './_gauge_live_data.jsx'
|
|
10
|
-
export { default as GaugeColors } from './_gauge_colors.jsx'
|
|
11
|
-
export { default as GaugeComplex } from './_gauge_complex.jsx'
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
# frozen_string_literal: true
|
|
2
|
-
|
|
3
|
-
module Playbook
|
|
4
|
-
module PbGauge
|
|
5
|
-
class Gauge < Playbook::KitBase
|
|
6
|
-
prop :chart_data, type: Playbook::Props::Array,
|
|
7
|
-
default: [{ name: "Name", value: 0 }]
|
|
8
|
-
prop :custom_options, default: {}
|
|
9
|
-
prop :style, type: Playbook::Props::Enum,
|
|
10
|
-
values: %w[solidgauge],
|
|
11
|
-
default: "solidgauge"
|
|
12
|
-
prop :title, type: Playbook::Props::String, default: ""
|
|
13
|
-
prop :prefix, type: Playbook::Props::String, default: ""
|
|
14
|
-
prop :suffix, type: Playbook::Props::String, default: ""
|
|
15
|
-
prop :height, type: Playbook::Props::String, default: nil
|
|
16
|
-
prop :tooltip_html, default: '<span style="font-weight: bold; color:{point.color};">●</span>
|
|
17
|
-
{point.name}: ' + '<b>{point.y}
|
|
18
|
-
</b>'
|
|
19
|
-
prop :full_circle, type: Playbook::Props::Boolean, default: false
|
|
20
|
-
prop :show_labels, type: Playbook::Props::Boolean, default: false
|
|
21
|
-
prop :disable_animation, type: Playbook::Props::Boolean, default: false
|
|
22
|
-
prop :min, type: Playbook::Props::Numeric, default: 0
|
|
23
|
-
prop :max, type: Playbook::Props::Numeric, default: 100
|
|
24
|
-
prop :colors, type: Playbook::Props::Array, default: []
|
|
25
|
-
|
|
26
|
-
def standard_options
|
|
27
|
-
{
|
|
28
|
-
id: id,
|
|
29
|
-
chartData: chart_data,
|
|
30
|
-
circumference: full_circle ? [0, 360] : [-100, 100],
|
|
31
|
-
dark: dark ? "dark" : "",
|
|
32
|
-
disableAnimation: disable_animation,
|
|
33
|
-
height: height,
|
|
34
|
-
min: min,
|
|
35
|
-
max: max,
|
|
36
|
-
title: title,
|
|
37
|
-
suffix: suffix,
|
|
38
|
-
prefix: prefix,
|
|
39
|
-
showLabels: show_labels,
|
|
40
|
-
style: style,
|
|
41
|
-
tooltipHtml: tooltip_html,
|
|
42
|
-
type: style,
|
|
43
|
-
colors: colors,
|
|
44
|
-
}
|
|
45
|
-
end
|
|
46
|
-
|
|
47
|
-
def chart_options
|
|
48
|
-
standard_options.deep_merge(custom_options)
|
|
49
|
-
end
|
|
50
|
-
|
|
51
|
-
def classname
|
|
52
|
-
generate_classname("pb_gauge_kit")
|
|
53
|
-
end
|
|
54
|
-
end
|
|
55
|
-
end
|
|
56
|
-
end
|
|
@@ -1,35 +0,0 @@
|
|
|
1
|
-
import React from 'react';
|
|
2
|
-
import { render, screen } from '../utilities/test-utils';
|
|
3
|
-
import Gauge from './_gauge';
|
|
4
|
-
|
|
5
|
-
beforeEach(() => {
|
|
6
|
-
// Silences error logs within the test suite.
|
|
7
|
-
jest.spyOn(console, 'error');
|
|
8
|
-
jest.spyOn(console, 'warn');
|
|
9
|
-
console.error.mockImplementation(() => {});
|
|
10
|
-
console.warn.mockImplementation(() => {});
|
|
11
|
-
});
|
|
12
|
-
|
|
13
|
-
afterEach(() => {
|
|
14
|
-
console.error.mockRestore();
|
|
15
|
-
console.warn.mockRestore();
|
|
16
|
-
});
|
|
17
|
-
|
|
18
|
-
const testId = 'gauge1';
|
|
19
|
-
|
|
20
|
-
test('uses exact classname', () => {
|
|
21
|
-
const data = [
|
|
22
|
-
{ name: 'Name', value: 45 },
|
|
23
|
-
]
|
|
24
|
-
render(
|
|
25
|
-
<Gauge
|
|
26
|
-
chartData={data}
|
|
27
|
-
data={{ testid: testId }}
|
|
28
|
-
id='gaugeid'
|
|
29
|
-
/>
|
|
30
|
-
);
|
|
31
|
-
|
|
32
|
-
const kit = screen.getByTestId(testId);
|
|
33
|
-
expect(kit).toHaveClass('pb_gauge_kit');
|
|
34
|
-
});
|
|
35
|
-
|
|
@@ -1,91 +0,0 @@
|
|
|
1
|
-
import colors from '../tokens/exports/_colors.module.scss'
|
|
2
|
-
import typography from '../tokens/exports/_typography.module.scss'
|
|
3
|
-
|
|
4
|
-
const gaugeTheme = {
|
|
5
|
-
title: {
|
|
6
|
-
text: "",
|
|
7
|
-
style: {
|
|
8
|
-
fontFamily: typography.font_family_base,
|
|
9
|
-
fontSize: typography.text_larger,
|
|
10
|
-
},
|
|
11
|
-
},
|
|
12
|
-
chart: {
|
|
13
|
-
type: "solidgauge",
|
|
14
|
-
events: {
|
|
15
|
-
render() {
|
|
16
|
-
this.container
|
|
17
|
-
const arc = this.container.querySelector('path.gauge-pane');
|
|
18
|
-
if (arc) arc.setAttribute('stroke-linejoin', 'round');
|
|
19
|
-
}
|
|
20
|
-
}
|
|
21
|
-
},
|
|
22
|
-
pane: {
|
|
23
|
-
size: "90%",
|
|
24
|
-
startAngle: -100,
|
|
25
|
-
endAngle: 100,
|
|
26
|
-
background: [
|
|
27
|
-
{
|
|
28
|
-
borderWidth: 20,
|
|
29
|
-
innerRadius: "90%",
|
|
30
|
-
outerRadius: "90%",
|
|
31
|
-
shape: "arc",
|
|
32
|
-
className: "gauge-pane",
|
|
33
|
-
borderColor: colors.border_light,
|
|
34
|
-
borderRadius: '50%',
|
|
35
|
-
},
|
|
36
|
-
],
|
|
37
|
-
},
|
|
38
|
-
tooltip: {
|
|
39
|
-
backgroundColor: {
|
|
40
|
-
linearGradient: { x1: 0, y1: 0, x2: 0, y2: 1 },
|
|
41
|
-
stops: [
|
|
42
|
-
[0, colors.bg_dark],
|
|
43
|
-
[1, colors.bg_dark],
|
|
44
|
-
],
|
|
45
|
-
},
|
|
46
|
-
pointFormat:
|
|
47
|
-
'<span style="font-weight: bold; color:{point.color};">●</span>{point.name}: ' +
|
|
48
|
-
"<b>{point.y}</b>",
|
|
49
|
-
followPointer: true,
|
|
50
|
-
shadow: false,
|
|
51
|
-
borderWidth: 0,
|
|
52
|
-
borderRadius: 10,
|
|
53
|
-
style: {
|
|
54
|
-
fontFamily: typography.font_family_base,
|
|
55
|
-
color: colors.text_dk_default,
|
|
56
|
-
fontWeight: typography.regular,
|
|
57
|
-
fontSize: typography.text_smaller,
|
|
58
|
-
},
|
|
59
|
-
},
|
|
60
|
-
yAxis: {
|
|
61
|
-
min: 0,
|
|
62
|
-
max: 100,
|
|
63
|
-
lineWidth: 0,
|
|
64
|
-
tickPositions: [] as number[],
|
|
65
|
-
},
|
|
66
|
-
plotOptions: {
|
|
67
|
-
solidgauge: {
|
|
68
|
-
borderColor: colors.data_1,
|
|
69
|
-
borderWidth: 20,
|
|
70
|
-
color: colors.data_1,
|
|
71
|
-
radius: 90,
|
|
72
|
-
innerRadius: "90%",
|
|
73
|
-
y: -26,
|
|
74
|
-
dataLabels: {
|
|
75
|
-
borderWidth: 0,
|
|
76
|
-
color: colors.text_lt_default,
|
|
77
|
-
enabled: true,
|
|
78
|
-
format: '<span class="fix">{y:,f}</span>',
|
|
79
|
-
style: {
|
|
80
|
-
fontFamily: typography.font_family_base,
|
|
81
|
-
fontWeight: typography.regular,
|
|
82
|
-
fontSize: typography.heading_2,
|
|
83
|
-
},
|
|
84
|
-
y: -26,
|
|
85
|
-
},
|
|
86
|
-
},
|
|
87
|
-
},
|
|
88
|
-
credits: { enabled: false }
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
export default gaugeTheme;
|
|
@@ -1,166 +0,0 @@
|
|
|
1
|
-
import React, { useState, useEffect } from "react";
|
|
2
|
-
import classnames from "classnames";
|
|
3
|
-
import { globalProps } from "../utilities/globalProps";
|
|
4
|
-
import { buildAriaProps, buildDataProps, buildHtmlProps } from "../utilities/props";
|
|
5
|
-
import { deprecatedKitWarning} from "../utilities/deprecated";
|
|
6
|
-
|
|
7
|
-
import HighchartsReact from "highcharts-react-official";
|
|
8
|
-
import Highcharts from "highcharts";
|
|
9
|
-
import { highchartsTheme } from "../pb_dashboard/pbChartsLightTheme";
|
|
10
|
-
import { highchartsDarkTheme } from "../pb_dashboard/pbChartsDarkTheme";
|
|
11
|
-
import mapColors from "../pb_dashboard/pbChartsColorsHelper";
|
|
12
|
-
import { merge } from '../utilities/object'
|
|
13
|
-
|
|
14
|
-
type LineGraphProps = {
|
|
15
|
-
align?: "left" | "right" | "center";
|
|
16
|
-
axisTitle?: string;
|
|
17
|
-
dark?: boolean;
|
|
18
|
-
xAxisCategories: [];
|
|
19
|
-
yAxisMin: number;
|
|
20
|
-
yAxisMax: number;
|
|
21
|
-
className?: string;
|
|
22
|
-
chartData: {
|
|
23
|
-
name: string;
|
|
24
|
-
data: number[];
|
|
25
|
-
}[];
|
|
26
|
-
customOptions?: Partial<Highcharts.Options>;
|
|
27
|
-
gradient?: boolean;
|
|
28
|
-
htmlOptions?: {[key: string]: string | number | boolean | (() => void)},
|
|
29
|
-
id: string;
|
|
30
|
-
pointStart: number;
|
|
31
|
-
subTitle?: string;
|
|
32
|
-
title: string;
|
|
33
|
-
type?: string;
|
|
34
|
-
legend?: boolean;
|
|
35
|
-
toggleLegendClick?: boolean;
|
|
36
|
-
height?: string;
|
|
37
|
-
colors: string[];
|
|
38
|
-
layout?: "horizontal" | "vertical" | "proximate";
|
|
39
|
-
verticalAlign?: "top" | "middle" | "bottom";
|
|
40
|
-
x?: number;
|
|
41
|
-
y?: number;
|
|
42
|
-
aria?: { [key: string]: string };
|
|
43
|
-
data?: { [key: string]: string };
|
|
44
|
-
};
|
|
45
|
-
|
|
46
|
-
const LineGraph = ({
|
|
47
|
-
aria = {},
|
|
48
|
-
data = {},
|
|
49
|
-
align = "center",
|
|
50
|
-
className = "pb_bar_graph",
|
|
51
|
-
customOptions = {},
|
|
52
|
-
dark = false,
|
|
53
|
-
gradient = false,
|
|
54
|
-
type = "line",
|
|
55
|
-
htmlOptions = {},
|
|
56
|
-
id,
|
|
57
|
-
legend = false,
|
|
58
|
-
toggleLegendClick = true,
|
|
59
|
-
layout = "horizontal",
|
|
60
|
-
verticalAlign = "bottom",
|
|
61
|
-
x = 0,
|
|
62
|
-
y = 0,
|
|
63
|
-
axisTitle,
|
|
64
|
-
xAxisCategories,
|
|
65
|
-
yAxisMin,
|
|
66
|
-
yAxisMax,
|
|
67
|
-
chartData,
|
|
68
|
-
pointStart,
|
|
69
|
-
subTitle,
|
|
70
|
-
title,
|
|
71
|
-
height,
|
|
72
|
-
colors = [],
|
|
73
|
-
...props
|
|
74
|
-
}: LineGraphProps) => {
|
|
75
|
-
|
|
76
|
-
const ariaProps = buildAriaProps(aria)
|
|
77
|
-
const dataProps = buildDataProps(data)
|
|
78
|
-
const htmlProps = buildHtmlProps(htmlOptions)
|
|
79
|
-
|
|
80
|
-
const setupTheme = () => {
|
|
81
|
-
dark
|
|
82
|
-
? Highcharts.setOptions(highchartsDarkTheme)
|
|
83
|
-
: Highcharts.setOptions(highchartsTheme);
|
|
84
|
-
};
|
|
85
|
-
setupTheme();
|
|
86
|
-
|
|
87
|
-
const staticOptions = {
|
|
88
|
-
title: {
|
|
89
|
-
text: title,
|
|
90
|
-
},
|
|
91
|
-
chart: {
|
|
92
|
-
height: height,
|
|
93
|
-
type: type,
|
|
94
|
-
},
|
|
95
|
-
subtitle: {
|
|
96
|
-
text: subTitle,
|
|
97
|
-
},
|
|
98
|
-
yAxis: {
|
|
99
|
-
min: yAxisMin,
|
|
100
|
-
max: yAxisMax,
|
|
101
|
-
title: {
|
|
102
|
-
text: axisTitle,
|
|
103
|
-
},
|
|
104
|
-
},
|
|
105
|
-
xAxis: {
|
|
106
|
-
categories: xAxisCategories,
|
|
107
|
-
},
|
|
108
|
-
legend: {
|
|
109
|
-
enabled: legend,
|
|
110
|
-
align: align,
|
|
111
|
-
verticalAlign: verticalAlign,
|
|
112
|
-
layout: layout,
|
|
113
|
-
x: x,
|
|
114
|
-
y: y,
|
|
115
|
-
},
|
|
116
|
-
colors:
|
|
117
|
-
colors !== undefined && colors.length > 0
|
|
118
|
-
? mapColors(colors)
|
|
119
|
-
: highchartsTheme.colors,
|
|
120
|
-
plotOptions: {
|
|
121
|
-
series: {
|
|
122
|
-
pointStart: pointStart,
|
|
123
|
-
events: {},
|
|
124
|
-
dataLabels: {
|
|
125
|
-
enabled: false,
|
|
126
|
-
},
|
|
127
|
-
},
|
|
128
|
-
},
|
|
129
|
-
series: chartData,
|
|
130
|
-
credits: false,
|
|
131
|
-
};
|
|
132
|
-
|
|
133
|
-
if (!toggleLegendClick) {
|
|
134
|
-
staticOptions.plotOptions.series.events = { legendItemClick: () => false };
|
|
135
|
-
}
|
|
136
|
-
|
|
137
|
-
const filteredProps: any = {...props};
|
|
138
|
-
delete filteredProps.verticalAlign;
|
|
139
|
-
|
|
140
|
-
const [options, setOptions] = useState({});
|
|
141
|
-
|
|
142
|
-
useEffect(() => {
|
|
143
|
-
setOptions(merge(staticOptions, customOptions));
|
|
144
|
-
}, [chartData]);
|
|
145
|
-
|
|
146
|
-
useEffect(() => {
|
|
147
|
-
// Warn about deprecated kit
|
|
148
|
-
deprecatedKitWarning('LineGraph', 'Please use "PbLineGraph" instead.');
|
|
149
|
-
}, []);
|
|
150
|
-
|
|
151
|
-
return (
|
|
152
|
-
<HighchartsReact
|
|
153
|
-
containerProps={{
|
|
154
|
-
className: classnames(globalProps(filteredProps), className),
|
|
155
|
-
id: id,
|
|
156
|
-
...ariaProps,
|
|
157
|
-
...dataProps,
|
|
158
|
-
...htmlProps
|
|
159
|
-
}}
|
|
160
|
-
highcharts={Highcharts}
|
|
161
|
-
options={options}
|
|
162
|
-
/>
|
|
163
|
-
);
|
|
164
|
-
};
|
|
165
|
-
|
|
166
|
-
export default LineGraph;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
**Important Note for the React Kit**: In order to leverage this kit, you must install `highcharts` and `highcharts-react-official` into your project as shown below. To then apply Playbook styles to your Highchart, import lineGraphTheme.ts from playbook-ui and merge it with your Highchart options. Then, pass the merged value to the options prop. Playbook’s styling will be applied automatically. See the examples in the documentation below.
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<% data = [{
|
|
2
|
-
name: 'Installation',
|
|
3
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
|
|
4
|
-
}, {
|
|
5
|
-
name: 'Manufacturing',
|
|
6
|
-
data: [24916, 28064, 29742, 40851, 50590, 65282, 70121, 85434]
|
|
7
|
-
}, {
|
|
8
|
-
name: 'Sales & Distribution',
|
|
9
|
-
data: [11744, 17722, 16005, 19771, 25185, 28377, 36147, 43387]
|
|
10
|
-
}, {
|
|
11
|
-
name: 'Project Development',
|
|
12
|
-
data: [5332, 6344, 7988, 12169, 15112, 14452, 22400, 30227]
|
|
13
|
-
}, {
|
|
14
|
-
name: 'Other',
|
|
15
|
-
data: [nil, nil, nil, 3112, 4989, 5816, 15274, 18111]
|
|
16
|
-
}] %>
|
|
17
|
-
|
|
18
|
-
<%= pb_rails("line_graph", props: {
|
|
19
|
-
id: "line-colors",
|
|
20
|
-
gradient: false,
|
|
21
|
-
chart_data: data,
|
|
22
|
-
x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
|
|
23
|
-
title: 'Line Graph with Custom Data Colors',
|
|
24
|
-
axis_title: 'Number of Employees',
|
|
25
|
-
colors: ['data-4', 'data-5', 'data-6', 'data-7', 'data-8']
|
|
26
|
-
}) %>
|
|
@@ -1,56 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import lineGraphTheme from '../lineGraphTheme'
|
|
3
|
-
import Highcharts from "highcharts"
|
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
|
5
|
-
import colors from '../../tokens/exports/_colors.module.scss'
|
|
6
|
-
|
|
7
|
-
const data = [{
|
|
8
|
-
name: 'Installation',
|
|
9
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
|
10
|
-
}, {
|
|
11
|
-
name: 'Manufacturing',
|
|
12
|
-
data: [24916, 28064, 29742, 40851, 50590, 65282, 70121, 85434],
|
|
13
|
-
}, {
|
|
14
|
-
name: 'Sales & Distribution',
|
|
15
|
-
data: [11744, 17722, 16005, 19771, 25185, 28377, 36147, 43387],
|
|
16
|
-
}, {
|
|
17
|
-
name: 'Project Development',
|
|
18
|
-
data: [5332, 6344, 7988, 12169, 15112, 14452, 22400, 30227],
|
|
19
|
-
}, {
|
|
20
|
-
name: 'Other',
|
|
21
|
-
data: [null, null, null, 3112, 4989, 5816, 15274, 18111],
|
|
22
|
-
}]
|
|
23
|
-
|
|
24
|
-
const categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
25
|
-
|
|
26
|
-
const LineGraphColors = () => {
|
|
27
|
-
const chartOptions = {
|
|
28
|
-
title: {
|
|
29
|
-
text: 'Line Graph with Custom Data Colors',
|
|
30
|
-
},
|
|
31
|
-
xAxis: {
|
|
32
|
-
categories: categories,
|
|
33
|
-
},
|
|
34
|
-
yAxis: {
|
|
35
|
-
min: 0,
|
|
36
|
-
title: {
|
|
37
|
-
text: 'Number of Employees',
|
|
38
|
-
},
|
|
39
|
-
},
|
|
40
|
-
series: data,
|
|
41
|
-
colors: [colors.data_4, colors.data_5, "#144075", colors.data_7, colors.data_8]
|
|
42
|
-
}
|
|
43
|
-
|
|
44
|
-
const options = Highcharts.merge({}, lineGraphTheme, chartOptions)
|
|
45
|
-
|
|
46
|
-
return (
|
|
47
|
-
<div>
|
|
48
|
-
<HighchartsReact
|
|
49
|
-
highcharts={Highcharts}
|
|
50
|
-
options={options}
|
|
51
|
-
/>
|
|
52
|
-
</div>
|
|
53
|
-
)
|
|
54
|
-
}
|
|
55
|
-
|
|
56
|
-
export default LineGraphColors
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<% data = [{
|
|
2
|
-
name: 'Installation',
|
|
3
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
|
|
4
|
-
}, {
|
|
5
|
-
name: 'Manufacturing',
|
|
6
|
-
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434]
|
|
7
|
-
}, {
|
|
8
|
-
name: 'Sales & Distribution',
|
|
9
|
-
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387]
|
|
10
|
-
}, {
|
|
11
|
-
name: 'Project Development',
|
|
12
|
-
data: [nil, nil, 7988, 12169, 15112, 22452, 34400, 34227]
|
|
13
|
-
}, {
|
|
14
|
-
name: 'Other',
|
|
15
|
-
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111]
|
|
16
|
-
}] %>
|
|
17
|
-
|
|
18
|
-
<%= pb_rails("line_graph", props: {
|
|
19
|
-
id: "line-default",
|
|
20
|
-
gradient: false,
|
|
21
|
-
chart_data: data,
|
|
22
|
-
x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
|
|
23
|
-
title: 'Solar Employment Growth by Sector, 2010-2016',
|
|
24
|
-
subtitle: 'Source: thesolarfoundation.com',
|
|
25
|
-
axis_title: 'Number of Employees'
|
|
26
|
-
}) %>
|
|
@@ -1,52 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import lineGraphTheme from '../lineGraphTheme'
|
|
3
|
-
import Highcharts from "highcharts"
|
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
|
5
|
-
|
|
6
|
-
const data = [{
|
|
7
|
-
name: 'Installation',
|
|
8
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
|
9
|
-
}, {
|
|
10
|
-
name: 'Manufacturing',
|
|
11
|
-
data: [24916, 24064, 29742, 29851, 32490, 30282, 38121, 40434],
|
|
12
|
-
}, {
|
|
13
|
-
name: 'Sales & Distribution',
|
|
14
|
-
data: [11744, 17722, 16005, 19771, 20185, 24377, 32147, 39387],
|
|
15
|
-
}, {
|
|
16
|
-
name: 'Project Development',
|
|
17
|
-
data: [null, null, 7988, 12169, 15112, 22452, 34400, 34227],
|
|
18
|
-
}, {
|
|
19
|
-
name: 'Other',
|
|
20
|
-
data: [12908, 5948, 8105, 11248, 8989, 11816, 18274, 18111],
|
|
21
|
-
}]
|
|
22
|
-
|
|
23
|
-
const categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
24
|
-
|
|
25
|
-
const chartOptions = {
|
|
26
|
-
series: data,
|
|
27
|
-
title: { text: "Solar Employment Growth by Sector, 2010-2016" },
|
|
28
|
-
subtitle: { text: "Source: thesolarfoundation.com" },
|
|
29
|
-
xAxis: {
|
|
30
|
-
categories: categories,
|
|
31
|
-
},
|
|
32
|
-
yAxis: {
|
|
33
|
-
title: {
|
|
34
|
-
text: "Number of Employees",
|
|
35
|
-
},
|
|
36
|
-
},
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
const LineGraphDefault = () => {
|
|
40
|
-
const options = Highcharts.merge({}, lineGraphTheme, chartOptions)
|
|
41
|
-
|
|
42
|
-
return(
|
|
43
|
-
<div>
|
|
44
|
-
<HighchartsReact
|
|
45
|
-
highcharts={Highcharts}
|
|
46
|
-
options={options}
|
|
47
|
-
/>
|
|
48
|
-
</div>
|
|
49
|
-
)
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
export default LineGraphDefault
|
|
@@ -1,26 +0,0 @@
|
|
|
1
|
-
<% data = [{
|
|
2
|
-
name: 'Number of Installations',
|
|
3
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
|
|
4
|
-
}] %>
|
|
5
|
-
|
|
6
|
-
<%= pb_rails("line_graph", props: {
|
|
7
|
-
id: "line-fixed-height",
|
|
8
|
-
gradient: false,
|
|
9
|
-
chart_data: data,
|
|
10
|
-
x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
|
|
11
|
-
title: 'Fixed Height (300px)',
|
|
12
|
-
axis_title: 'Number of Employees',
|
|
13
|
-
height: '300'
|
|
14
|
-
}) %>
|
|
15
|
-
|
|
16
|
-
<br /><br />
|
|
17
|
-
|
|
18
|
-
<%= pb_rails("line_graph", props: {
|
|
19
|
-
id: "line-precentage-height",
|
|
20
|
-
gradient: false,
|
|
21
|
-
chart_data: data,
|
|
22
|
-
x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug','Sep','Oct','Nov','Dec'],
|
|
23
|
-
title: 'Percentage Height (50%)',
|
|
24
|
-
axis_title: 'Number of Employees',
|
|
25
|
-
height: '50%'
|
|
26
|
-
}) %>
|
|
@@ -1,70 +0,0 @@
|
|
|
1
|
-
import React from 'react'
|
|
2
|
-
import lineGraphTheme from '../lineGraphTheme'
|
|
3
|
-
import Highcharts from "highcharts"
|
|
4
|
-
import HighchartsReact from "highcharts-react-official"
|
|
5
|
-
|
|
6
|
-
const data = [{
|
|
7
|
-
name: 'Number of Installations',
|
|
8
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175],
|
|
9
|
-
}]
|
|
10
|
-
|
|
11
|
-
const categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
|
|
12
|
-
|
|
13
|
-
const LineGraphHeight = () => {
|
|
14
|
-
const chartOptionsFirst = {
|
|
15
|
-
title: {
|
|
16
|
-
text: 'Fixed Height (300px)',
|
|
17
|
-
},
|
|
18
|
-
chart: {
|
|
19
|
-
height: '300px'
|
|
20
|
-
},
|
|
21
|
-
xAxis: {
|
|
22
|
-
categories: categories,
|
|
23
|
-
},
|
|
24
|
-
yAxis: {
|
|
25
|
-
min: 0,
|
|
26
|
-
title: {
|
|
27
|
-
text: 'Number of Employees',
|
|
28
|
-
},
|
|
29
|
-
},
|
|
30
|
-
series: data
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
const chartOptionsSecond = {
|
|
34
|
-
title: {
|
|
35
|
-
text: 'Percentage Height (50%)',
|
|
36
|
-
},
|
|
37
|
-
chart: {
|
|
38
|
-
height: '50%'
|
|
39
|
-
},
|
|
40
|
-
xAxis: {
|
|
41
|
-
categories: categories,
|
|
42
|
-
},
|
|
43
|
-
yAxis: {
|
|
44
|
-
min: 0,
|
|
45
|
-
title: {
|
|
46
|
-
text: 'Number of Employees',
|
|
47
|
-
},
|
|
48
|
-
},
|
|
49
|
-
series: data
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const optionsFirst = Highcharts.merge({}, lineGraphTheme, chartOptionsFirst)
|
|
53
|
-
const optionsSecond = Highcharts.merge({}, lineGraphTheme, chartOptionsSecond)
|
|
54
|
-
|
|
55
|
-
return (
|
|
56
|
-
<div>
|
|
57
|
-
<HighchartsReact
|
|
58
|
-
highcharts={Highcharts}
|
|
59
|
-
options={optionsFirst}
|
|
60
|
-
/>
|
|
61
|
-
|
|
62
|
-
<HighchartsReact
|
|
63
|
-
highcharts={Highcharts}
|
|
64
|
-
options={optionsSecond}
|
|
65
|
-
/>
|
|
66
|
-
</div>
|
|
67
|
-
)
|
|
68
|
-
}
|
|
69
|
-
|
|
70
|
-
export default LineGraphHeight
|
|
@@ -1,3 +0,0 @@
|
|
|
1
|
-
By default, Highcharts have a height of 400px, but this can be customized. You can override the default by specifying either a percentage or a fixed pixel value.
|
|
2
|
-
|
|
3
|
-
Using a percentage maintains a consistent aspect ratio across different responsive sizes. For example, setting the height to 50% makes the chart’s height half of its width.
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
<% data = [{
|
|
2
|
-
name: 'Number of Installations',
|
|
3
|
-
data: [43934, 52503, 57177, 69658, 97031, 119931, 137133, 154175]
|
|
4
|
-
}] %>
|
|
5
|
-
|
|
6
|
-
<%= pb_rails("line_graph", props: {
|
|
7
|
-
id: "line-test-2",
|
|
8
|
-
gradient: false,
|
|
9
|
-
chart_data: data,
|
|
10
|
-
x_axis_categories:['Jan','Feb','Mar','Apr','May','Jun','Jul','Aug'],
|
|
11
|
-
title: 'Line Graph with Legend',
|
|
12
|
-
axis_title: 'Number of Employees',
|
|
13
|
-
legend: true
|
|
14
|
-
}) %>
|
|
15
|
-
|