| 1 | package chart |
| 2 | |
| 3 | const ( |
| 4 | // DefaultChartHeight is the default chart height. |
| 5 | DefaultChartHeight = 400 |
| 6 | // DefaultChartWidth is the default chart width. |
| 7 | DefaultChartWidth = 1024 |
| 8 | // DefaultStrokeWidth is the default chart stroke width. |
| 9 | DefaultStrokeWidth = 0.0 |
| 10 | // DefaultDotWidth is the default chart dot width. |
| 11 | DefaultDotWidth = 0.0 |
| 12 | // DefaultSeriesLineWidth is the default line width. |
| 13 | DefaultSeriesLineWidth = 1.0 |
| 14 | // DefaultAxisLineWidth is the line width of the axis lines. |
| 15 | DefaultAxisLineWidth = 1.0 |
| 16 | //DefaultDPI is the default dots per inch for the chart. |
| 17 | DefaultDPI = 92.0 |
| 18 | // DefaultMinimumFontSize is the default minimum font size. |
| 19 | DefaultMinimumFontSize = 8.0 |
| 20 | // DefaultFontSize is the default font size. |
| 21 | DefaultFontSize = 10.0 |
| 22 | // DefaultTitleFontSize is the default title font size. |
| 23 | DefaultTitleFontSize = 18.0 |
| 24 | // DefaultAnnotationDeltaWidth is the width of the left triangle out of annotations. |
| 25 | DefaultAnnotationDeltaWidth = 10 |
| 26 | // DefaultAnnotationFontSize is the font size of annotations. |
| 27 | DefaultAnnotationFontSize = 10.0 |
| 28 | // DefaultAxisFontSize is the font size of the axis labels. |
| 29 | DefaultAxisFontSize = 10.0 |
| 30 | // DefaultTitleTop is the default distance from the top of the chart to put the title. |
| 31 | DefaultTitleTop = 10 |
| 32 | |
| 33 | // DefaultBackgroundStrokeWidth is the default stroke on the chart background. |
| 34 | DefaultBackgroundStrokeWidth = 0.0 |
| 35 | // DefaultCanvasStrokeWidth is the default stroke on the chart canvas. |
| 36 | DefaultCanvasStrokeWidth = 0.0 |
| 37 | |
| 38 | // DefaultLineSpacing is the default vertical distance between lines of text. |
| 39 | DefaultLineSpacing = 5 |
| 40 | |
| 41 | // DefaultYAxisMargin is the default distance from the right of the canvas to the y axis labels. |
| 42 | DefaultYAxisMargin = 10 |
| 43 | // DefaultXAxisMargin is the default distance from bottom of the canvas to the x axis labels. |
| 44 | DefaultXAxisMargin = 10 |
| 45 | |
| 46 | //DefaultVerticalTickHeight is half the margin. |
| 47 | DefaultVerticalTickHeight = DefaultXAxisMargin >> 1 |
| 48 | //DefaultHorizontalTickWidth is half the margin. |
| 49 | DefaultHorizontalTickWidth = DefaultYAxisMargin >> 1 |
| 50 | |
| 51 | // DefaultTickCount is the default number of ticks to show |
| 52 | DefaultTickCount = 10 |
| 53 | // DefaultTickCountSanityCheck is a hard limit on number of ticks to prevent infinite loops. |
| 54 | DefaultTickCountSanityCheck = 1 << 10 //1024 |
| 55 | |
| 56 | // DefaultMinimumTickHorizontalSpacing is the minimum distance between horizontal ticks. |
| 57 | DefaultMinimumTickHorizontalSpacing = 20 |
| 58 | // DefaultMinimumTickVerticalSpacing is the minimum distance between vertical ticks. |
| 59 | DefaultMinimumTickVerticalSpacing = 20 |
| 60 | |
| 61 | // DefaultDateFormat is the default date format. |
| 62 | DefaultDateFormat = "2006-01-02" |
| 63 | // DefaultDateHourFormat is the date format for hour timestamp formats. |
| 64 | DefaultDateHourFormat = "01-02 3PM" |
| 65 | // DefaultDateMinuteFormat is the date format for minute range timestamp formats. |
| 66 | DefaultDateMinuteFormat = "01-02 3:04PM" |
| 67 | // DefaultFloatFormat is the default float format. |
| 68 | DefaultFloatFormat = "%.2f" |
| 69 | // DefaultPercentValueFormat is the default percent format. |
| 70 | DefaultPercentValueFormat = "%0.2f%%" |
| 71 | |
| 72 | // DefaultBarSpacing is the default pixel spacing between bars. |
| 73 | DefaultBarSpacing = 100 |
| 74 | // DefaultBarWidth is the default pixel width of bars in a bar chart. |
| 75 | DefaultBarWidth = 50 |
| 76 | ) |
| 77 | |
| 78 | var ( |
| 79 | // DashArrayDots is a dash array that represents '....' style stroke dashes. |
| 80 | DashArrayDots = []int{1, 1} |
| 81 | // DashArrayDashesSmall is a dash array that represents '- - -' style stroke dashes. |
| 82 | DashArrayDashesSmall = []int{3, 3} |
| 83 | // DashArrayDashesMedium is a dash array that represents '-- -- --' style stroke dashes. |
| 84 | DashArrayDashesMedium = []int{5, 5} |
| 85 | // DashArrayDashesLarge is a dash array that represents '----- ----- -----' style stroke dashes. |
| 86 | DashArrayDashesLarge = []int{10, 10} |
| 87 | ) |
| 88 | |
| 89 | var ( |
| 90 | // DefaultAnnotationPadding is the padding around an annotation. |
| 91 | DefaultAnnotationPadding = Box{Top: 5, Left: 5, Right: 5, Bottom: 5} |
| 92 | |
| 93 | // DefaultBackgroundPadding is the default canvas padding config. |
| 94 | DefaultBackgroundPadding = Box{Top: 5, Left: 5, Right: 5, Bottom: 5} |
| 95 | ) |
| 96 | |
| 97 | const ( |
| 98 | // ContentTypePNG is the png mime type. |
| 99 | ContentTypePNG = "image/png" |
| 100 | |
| 101 | // ContentTypeSVG is the svg mime type. |
| 102 | ContentTypeSVG = "image/svg+xml" |
| 103 | ) |