go-chart/defaults.go

104 lines
4.0 KiB
Go
Raw Normal View History

2016-07-07 03:54:00 +02:00
package chart
const (
// DefaultChartHeight is the default chart height.
DefaultChartHeight = 400
// DefaultChartWidth is the default chart width.
2016-07-17 05:53:46 +02:00
DefaultChartWidth = 1024
2017-02-23 02:47:08 +01:00
// DefaultStrokeWidth is the default chart stroke width.
DefaultStrokeWidth = 0.0
// DefaultDotWidth is the default chart dot width.
DefaultDotWidth = 0.0
2017-02-23 02:47:08 +01:00
// DefaultSeriesLineWidth is the default line width.
DefaultSeriesLineWidth = 1.0
2016-07-07 04:04:21 +02:00
// DefaultAxisLineWidth is the line width of the axis lines.
DefaultAxisLineWidth = 1.0
2016-07-07 03:54:00 +02:00
//DefaultDPI is the default dots per inch for the chart.
2016-07-09 02:57:14 +02:00
DefaultDPI = 92.0
2016-07-07 03:54:00 +02:00
// DefaultMinimumFontSize is the default minimum font size.
DefaultMinimumFontSize = 8.0
2016-07-07 23:44:03 +02:00
// DefaultFontSize is the default font size.
DefaultFontSize = 10.0
// DefaultTitleFontSize is the default title font size.
DefaultTitleFontSize = 18.0
2016-07-10 05:14:11 +02:00
// DefaultAnnotationDeltaWidth is the width of the left triangle out of annotations.
DefaultAnnotationDeltaWidth = 10
// DefaultAnnotationFontSize is the font size of annotations.
DefaultAnnotationFontSize = 10.0
2016-07-08 05:26:07 +02:00
// DefaultAxisFontSize is the font size of the axis labels.
DefaultAxisFontSize = 10.0
// DefaultTitleTop is the default distance from the top of the chart to put the title.
DefaultTitleTop = 10
2016-07-10 19:43:04 +02:00
2017-02-23 02:44:44 +01:00
// DefaultBackgroundStrokeWidth is the default stroke on the chart background.
DefaultBackgroundStrokeWidth = 0.0
// DefaultCanvasStrokeWidth is the default stroke on the chart canvas.
DefaultCanvasStrokeWidth = 0.0
2016-07-30 03:24:25 +02:00
// DefaultLineSpacing is the default vertical distance between lines of text.
DefaultLineSpacing = 5
2016-07-10 05:14:11 +02:00
// DefaultYAxisMargin is the default distance from the right of the canvas to the y axis labels.
2016-07-10 19:43:04 +02:00
DefaultYAxisMargin = 10
2016-07-08 05:26:07 +02:00
// DefaultXAxisMargin is the default distance from bottom of the canvas to the x axis labels.
DefaultXAxisMargin = 10
2016-07-10 19:43:04 +02:00
2016-07-12 03:48:51 +02:00
//DefaultVerticalTickHeight is half the margin.
DefaultVerticalTickHeight = DefaultXAxisMargin >> 1
2016-07-10 19:43:04 +02:00
//DefaultHorizontalTickWidth is half the margin.
2016-07-12 03:48:51 +02:00
DefaultHorizontalTickWidth = DefaultYAxisMargin >> 1
2016-07-13 20:50:22 +02:00
// DefaultTickCount is the default number of ticks to show
2016-07-12 03:48:51 +02:00
DefaultTickCount = 10
2016-07-13 20:50:22 +02:00
// DefaultTickCountSanityCheck is a hard limit on number of ticks to prevent infinite loops.
DefaultTickCountSanityCheck = 1 << 10 //1024
2016-07-10 19:43:04 +02:00
2016-07-08 05:26:07 +02:00
// DefaultMinimumTickHorizontalSpacing is the minimum distance between horizontal ticks.
DefaultMinimumTickHorizontalSpacing = 20
// DefaultMinimumTickVerticalSpacing is the minimum distance between vertical ticks.
DefaultMinimumTickVerticalSpacing = 20
2016-07-10 19:43:04 +02:00
2016-07-08 02:50:16 +02:00
// DefaultDateFormat is the default date format.
DefaultDateFormat = "2006-01-02"
2016-07-14 20:17:57 +02:00
// DefaultDateHourFormat is the date format for hour timestamp formats.
2016-07-14 20:36:47 +02:00
DefaultDateHourFormat = "01-02 3PM"
// DefaultDateMinuteFormat is the date format for minute range timestamp formats.
2016-07-27 09:34:10 +02:00
DefaultDateMinuteFormat = "01-02 3:04PM"
2016-07-14 20:17:57 +02:00
// DefaultFloatFormat is the default float format.
DefaultFloatFormat = "%.2f"
2016-07-14 20:21:41 +02:00
// DefaultPercentValueFormat is the default percent format.
DefaultPercentValueFormat = "%0.2f%%"
2016-08-06 05:08:24 +02:00
// DefaultBarSpacing is the default pixel spacing between bars.
DefaultBarSpacing = 100
// DefaultBarWidth is the default pixel width of bars in a bar chart.
DefaultBarWidth = 50
)
2016-07-12 03:48:51 +02:00
var (
// DashArrayDots is a dash array that represents '....' style stroke dashes.
DashArrayDots = []int{1, 1}
// DashArrayDashesSmall is a dash array that represents '- - -' style stroke dashes.
DashArrayDashesSmall = []int{3, 3}
// DashArrayDashesMedium is a dash array that represents '-- -- --' style stroke dashes.
DashArrayDashesMedium = []int{5, 5}
// DashArrayDashesLarge is a dash array that represents '----- ----- -----' style stroke dashes.
DashArrayDashesLarge = []int{10, 10}
)
2016-07-08 02:50:16 +02:00
var (
2016-07-10 05:14:11 +02:00
// DefaultAnnotationPadding is the padding around an annotation.
2016-07-15 06:14:46 +02:00
DefaultAnnotationPadding = Box{Top: 5, Left: 5, Right: 5, Bottom: 5}
2016-07-08 02:50:16 +02:00
// DefaultBackgroundPadding is the default canvas padding config.
DefaultBackgroundPadding = Box{Top: 5, Left: 5, Right: 5, Bottom: 5}
2016-07-07 23:44:03 +02:00
)
2017-03-06 08:52:13 +01:00
const (
// ContentTypePNG is the png mime type.
ContentTypePNG = "image/png"
// ContentTypeSVG is the svg mime type.
ContentTypeSVG = "image/svg+xml"
)