examples/chart_gauge.rb in write_xlsx-1.09.4 vs examples/chart_gauge.rb in write_xlsx-1.09.5
- old
+ new
@@ -26,40 +26,40 @@
worksheet.write_col('H2', ['Donut', 25, 50, 25, 100])
worksheet.write_col('I2', ['Pie', 75, 1, '=200-I4-I3'])
# Configure the doughnut chart as the background for the gauge.
chart_doughnut.add_series(
- :name => '=Sheet1!$H$2',
- :values => '=Sheet1!$H$3:$H$6',
- :points => [
- { :fill => { :color => 'green' } },
- { :fill => { :color => 'yellow' } },
- { :fill => { :color => 'red' } },
- { :fill => { :none => 1 } }
- ]
+ :name => '=Sheet1!$H$2',
+ :values => '=Sheet1!$H$3:$H$6',
+ :points => [
+ { :fill => { :color => 'green' } },
+ { :fill => { :color => 'yellow' } },
+ { :fill => { :color => 'red' } },
+ { :fill => { :none => 1 } }
+ ]
)
# Rotate chart so the gauge parts are above the horizontal.
chart_doughnut.set_rotation(270)
# Turn off the chart legend.
chart_doughnut.set_legend(:none => 1)
# Turn off the chart fill and border.
chart_doughnut.set_chartarea(
- :border => { :none => 1 },
- :fill => { :none => 1 }
+ :border => { :none => 1 },
+ :fill => { :none => 1 }
)
# Configure the pie chart as the needle for the gauge.
chart_pie.add_series(
- :name => '=Sheet1!$I$2',
- :values => '=Sheet1!$I$3:$I$6',
- :points => [
- { :fill => { :none => 1 } },
- { :fill => { :color => 'black' } },
- { :fill => { :none => 1 } }
- ]
+ :name => '=Sheet1!$I$2',
+ :values => '=Sheet1!$I$3:$I$6',
+ :points => [
+ { :fill => { :none => 1 } },
+ { :fill => { :color => 'black' } },
+ { :fill => { :none => 1 } }
+ ]
)
# Rotate the pie chart/needle to align with the doughnut/gauge.
chart_pie.set_rotation(270)