diff --git a/examples/stacked_bar/main.go b/examples/stacked_bar/main.go index ef65ca2..07304bc 100644 --- a/examples/stacked_bar/main.go +++ b/examples/stacked_bar/main.go @@ -10,6 +10,7 @@ import ( func drawChart(res http.ResponseWriter, req *http.Request) { sbc := chart.StackedBarChart{ + Height: 512, XAxis: chart.Style{ Show: true, }, @@ -48,8 +49,8 @@ func drawChart(res http.ResponseWriter, req *http.Request) { }, } - res.Header().Set("Content-Type", "image/svg+xml") - err := sbc.Render(chart.SVG, res) + res.Header().Set("Content-Type", "image/png") + err := sbc.Render(chart.PNG, res) if err != nil { fmt.Printf("Error rendering chart: %v\n", err) } diff --git a/images/stacked_bar.png b/images/stacked_bar.png new file mode 100644 index 0000000..4b0e9ae Binary files /dev/null and b/images/stacked_bar.png differ diff --git a/tick_test.go b/tick_test.go index ed04595..e1fd2f4 100644 --- a/tick_test.go +++ b/tick_test.go @@ -9,6 +9,6 @@ import ( func TestGenerateTicksWithStep(t *testing.T) { assert := assert.New(t) - ticks := GenerateContinuousTicksWithStep(&ContinuousRange{Min: 1.0, Max: 10.0, Domain: 100}, 1.0, FloatValueFormatter) + ticks := GenerateContinuousTicksWithStep(&ContinuousRange{Min: 1.0, Max: 10.0, Domain: 100}, 1.0, FloatValueFormatter, false) assert.Len(ticks, 10) } diff --git a/yaxis_test.go b/yaxis_test.go index 1941df5..7415b5c 100644 --- a/yaxis_test.go +++ b/yaxis_test.go @@ -23,7 +23,7 @@ func TestYAxisGetTicks(t *testing.T) { } vf := FloatValueFormatter ticks := ya.GetTicks(r, yr, styleDefaults, vf) - assert.Len(ticks, 35) + assert.Len(ticks, 36) } func TestYAxisGetTicksWithUserDefaults(t *testing.T) {