|
| 1 | +import { border, brand, font, spacing } from "../variables"; |
| 2 | +/* |
| 3 | +
|
| 4 | +DISCLAIMER: |
| 5 | +Do not change this file because it is core styling. |
| 6 | +Customizing core files will make updating Atlas much more difficult in the future. |
| 7 | +To customize any core styling, copy the part you want to customize to styles/native/app/ so the core styling is overwritten. |
| 8 | +
|
| 9 | +========================================================================== |
| 10 | + Line Chart |
| 11 | +
|
| 12 | + Default Class For Mendix Line Chart Widget |
| 13 | +========================================================================== */ |
| 14 | +// eslint-disable-next-line @typescript-eslint/camelcase |
| 15 | +export const com_mendix_widget_native_barchart_BarChart = { |
| 16 | + container: { |
| 17 | + // All ViewStyle properties are allowed |
| 18 | + }, |
| 19 | + errorMessage: { |
| 20 | + // All TextStyle properties are allowed |
| 21 | + fontFamily: font.family, |
| 22 | + fontSize: font.sizeSmall, |
| 23 | + fontWeight: font.weightNormal |
| 24 | + }, |
| 25 | + chart: { |
| 26 | + // All ViewStyle properties are allowed |
| 27 | + }, |
| 28 | + grid: { |
| 29 | + /* |
| 30 | + Allowed properties: |
| 31 | + - backgroundColor (string) |
| 32 | + - dashArray (string) |
| 33 | + - lineColor (string) |
| 34 | + - padding (number) |
| 35 | + - paddingBottom (number) |
| 36 | + - paddingHorizontal (number) |
| 37 | + - paddingLeft (number) |
| 38 | + - paddingRight (number) |
| 39 | + - paddingTop (number) |
| 40 | + - paddingVertical (number) |
| 41 | + - width (number) |
| 42 | + */ |
| 43 | + lineColor: border.color, |
| 44 | + paddingBottom: 32, |
| 45 | + paddingLeft: 32, |
| 46 | + paddingRight: 8, |
| 47 | + paddingTop: 8 |
| 48 | + }, |
| 49 | + xAxis: { |
| 50 | + /* |
| 51 | + Allowed properties: |
| 52 | + - color (string) |
| 53 | + - dashArray (string) |
| 54 | + - fontFamily (string) |
| 55 | + - fontSize (number) |
| 56 | + - fontStyle ("normal" or "italic") |
| 57 | + - fontWeight ("normal" or "bold" or "100" or "200" or "300" or "400" or "500" or "600" or "700" or "800" or "900") |
| 58 | + - lineColor (string) |
| 59 | + - width (number) |
| 60 | + */ |
| 61 | + color: font.color, |
| 62 | + fontFamily: font.family, |
| 63 | + fontSize: font.sizeSmall, |
| 64 | + fontWeight: font.weightNormal, |
| 65 | + lineColor: border.color, |
| 66 | + label: { |
| 67 | + /* |
| 68 | + All TextStyle properties are allowed and: |
| 69 | + - relativePositionGrid ("bottom" or "right") |
| 70 | + */ |
| 71 | + color: font.color, |
| 72 | + alignSelf: "center", |
| 73 | + marginHorizontal: 0, |
| 74 | + marginVertical: spacing.smallest, |
| 75 | + fontFamily: font.family, |
| 76 | + fontSize: font.sizeSmall, |
| 77 | + fontWeight: font.weightNormal, |
| 78 | + relativePositionGrid: "bottom" |
| 79 | + }, |
| 80 | + }, |
| 81 | + yAxis: { |
| 82 | + /* |
| 83 | + Allowed properties: |
| 84 | + - color (string) |
| 85 | + - dashArray (string) |
| 86 | + - fontFamily (string) |
| 87 | + - fontSize (number) |
| 88 | + - fontStyle ("normal" or "italic") |
| 89 | + - fontWeight ("normal" or "bold" or "100" or "200" or "300" or "400" or "500" or "600" or "700" or "800" or "900") |
| 90 | + - lineColor (string) |
| 91 | + - width (number) |
| 92 | + */ |
| 93 | + color: font.color, |
| 94 | + fontFamily: font.family, |
| 95 | + fontSize: font.sizeSmall, |
| 96 | + fontWeight: font.weightNormal, |
| 97 | + lineColor: border.color, |
| 98 | + label: { |
| 99 | + /* |
| 100 | + All TextStyle properties are allowed and: |
| 101 | + - relativePositionGrid ("top" or "left") |
| 102 | + */ |
| 103 | + color: font.color, |
| 104 | + marginHorizontal: 0, |
| 105 | + marginVertical: spacing.smallest, |
| 106 | + fontFamily: font.family, |
| 107 | + fontSize: font.sizeSmall, |
| 108 | + fontWeight: font.weightNormal, |
| 109 | + relativePositionGrid: "top" |
| 110 | + }, |
| 111 | + }, |
| 112 | + bars: { |
| 113 | + /* |
| 114 | + Allowed properties: |
| 115 | + - barColorPalette (string with array of colors separated by ';') |
| 116 | + - barsOffset (number) |
| 117 | +
|
| 118 | + */ |
| 119 | + barColorPalette: Object.values(brand) |
| 120 | + .map((color, index, brandColors) => (index === brandColors.length - 1 ? color : `${color};`)) |
| 121 | + .join(""), |
| 122 | + barsOffset: 20, |
| 123 | + customBarStyles: { |
| 124 | + your_static_or_dynamic_attribute_value: { |
| 125 | + bar: { |
| 126 | + /* |
| 127 | + Allowed properties: |
| 128 | + - ending (number) |
| 129 | + - barColor (string) |
| 130 | + - width (number) |
| 131 | + */ |
| 132 | + }, |
| 133 | + label: { |
| 134 | + /* |
| 135 | + Allowed properties: |
| 136 | + - fontFamily (string) |
| 137 | + - fontSize (number) |
| 138 | + - fontStyle ("normal" or "italic") |
| 139 | + - fontWeight ("normal" or "bold" or "100" or "200" or "300" or "400" or "500" or "600" or "700" or "800" or "900") |
| 140 | + */ |
| 141 | + } |
| 142 | + } |
| 143 | + } |
| 144 | + }, |
| 145 | + legend: { |
| 146 | + container: { |
| 147 | + // All ViewStyle properties are allowed |
| 148 | + justifyContent: "flex-start", |
| 149 | + marginHorizontal: 0, |
| 150 | + marginVertical: spacing.smallest |
| 151 | + }, |
| 152 | + item: { |
| 153 | + // All ViewStyle properties are allowed |
| 154 | + padding: 0, |
| 155 | + paddingRight: spacing.smaller |
| 156 | + }, |
| 157 | + indicator: { |
| 158 | + // All ViewStyle properties are allowed |
| 159 | + marginRight: spacing.smallest |
| 160 | + }, |
| 161 | + label: { |
| 162 | + // All TextStyle properties are allowed |
| 163 | + color: font.color, |
| 164 | + fontFamily: font.family, |
| 165 | + fontSize: font.sizeSmall, |
| 166 | + fontWeight: font.weightNormal |
| 167 | + } |
| 168 | + } |
| 169 | +}; |
0 commit comments