|
| 1 | +using DotNet.Highcharts.Attributes; |
| 2 | +using DotNet.Highcharts.Helpers; |
| 3 | + |
| 4 | +namespace DotNet.Highcharts.Options.DataOptions |
| 5 | +{ |
| 6 | + /// <summary> |
| 7 | + /// The Data module provides a simplified interface for adding data to a chart from sources like CVS, HTML tables or grid views. See also the tutorial article on the Data module. |
| 8 | + /// It requires the modules/data.js file to be loaded. |
| 9 | + /// Please note that the default way of adding data in Highcharts, without the need of a module, is through the series.data option. |
| 10 | + /// </summary> |
| 11 | + public class DataOptions |
| 12 | + { |
| 13 | + /// <summary> |
| 14 | + /// A callback function to modify the CSV before parsing it. Return the modified string. |
| 15 | + /// Default: undefined |
| 16 | + /// </summary> |
| 17 | + [JsonFormatter("{0}")] |
| 18 | + public string BeforeParse { get; set; } |
| 19 | + |
| 20 | + /// <summary> |
| 21 | + /// A two-dimensional array representing the input data on tabular form. This input can be used when the data is already parsed, for example from a grid view component. Each cell can be a string or number. If not switchRowsAndColumns is set, the columns are interpreted as series. |
| 22 | + /// Default: undefined |
| 23 | + /// </summary> |
| 24 | + public object[,] Columns { get; set; } |
| 25 | + |
| 26 | + /// <summary> |
| 27 | + /// A URL to a remote JSON dataset, structured as a column array. Will be fetched when the chart is created using Ajax. |
| 28 | + /// Default: undefined |
| 29 | + /// </summary> |
| 30 | + public string ColumnsURL { get; set; } |
| 31 | + |
| 32 | + /// <summary> |
| 33 | + /// The callback that is evaluated when the data is finished loading, optionally from an external source, and parsed. The first argument passed is a finished chart options object, containing the series. These options can be extended with additional options and passed directly to the chart constructor. |
| 34 | + /// Default: undefined |
| 35 | + /// </summary> |
| 36 | + [JsonFormatter("{0)")] |
| 37 | + public string Complete { get; set; } |
| 38 | + |
| 39 | + /// <summary> |
| 40 | + /// A comma delimited string to be parsed. Related options are startRow, endRow, startColumn and endColumn to delimit what part of the table is used. The lineDelimiter and itemDelimiter options define the CSV delimiter formats. |
| 41 | + /// The built-in CSV parser doesn't support all flavours of CSV, so in some cases it may be necessary to use an external CSV parser. See this example of parsing CSV through the MIT licensed Papa Parse library. |
| 42 | + /// Default: undefined |
| 43 | + /// </summary> |
| 44 | + public string Csv { get; set; } |
| 45 | + |
| 46 | + /// <summary> |
| 47 | + /// A URL to a remote CSV dataset. Will be fetched when the chart is created using Ajax. |
| 48 | + /// Default: undefined |
| 49 | + /// </summary> |
| 50 | + public string CsvURL { get; set; } |
| 51 | + |
| 52 | + /// <summary> |
| 53 | + /// Sets the refresh rate for data polling when importing remote dataset by setting data.csvURL, data.rowsURL, data.columnsURL, or data.googleSpreadsheetKey. |
| 54 | + /// Note that polling must be enabled by setting data.enablePolling to true. |
| 55 | + /// The value is the number of seconds between pollings. It cannot be set to less than 1 second. |
| 56 | + /// Default: 1 |
| 57 | + /// </summary> |
| 58 | + public Number? DataRefreshRate { get; set; } |
| 59 | + |
| 60 | + /// <summary> |
| 61 | + /// Which of the predefined date formats in Date.prototype.dateFormats to use to parse date values. Defaults to a best guess based on what format gives valid and ordered dates. |
| 62 | + /// Valid options include: |
| 63 | + /// YYYY/mm/dd |
| 64 | + /// dd/mm/YYYY |
| 65 | + /// mm/dd/YYYY |
| 66 | + /// dd/mm/YY |
| 67 | + /// mm/dd/YY |
| 68 | + /// Default: undefined |
| 69 | + /// </summary> |
| 70 | + public string DateFormat { get; set; } |
| 71 | + |
| 72 | + /// <summary> |
| 73 | + /// The decimal point used for parsing numbers in the CSV |
| 74 | + /// If both this and data.delimiter is set to false, the parser will attempt to deduce the decimal point automatically. |
| 75 | + /// Default: . . |
| 76 | + /// </summary> |
| 77 | + public string DecimalPoint { get; set; } |
| 78 | + |
| 79 | + /// <summary> |
| 80 | + /// Enables automatic refetching of remote datasets every n seconds (defined by setting data.dataRefreshRate). |
| 81 | + /// Only works when either data.csvURL, data.rowsURL, data.columnsURL, or data.googleSpreadsheetKey. |
| 82 | + /// Default: false |
| 83 | + /// </summary> |
| 84 | + public bool? EnablePolling { get; set; } |
| 85 | + |
| 86 | + /// <summary> |
| 87 | + /// In tabular input data, the last column (indexed by 0) to use. Defaults to the last column containing data. |
| 88 | + /// Default: undefined |
| 89 | + /// </summary> |
| 90 | + public Number? EndColumn { get; set; } |
| 91 | + |
| 92 | + /// <summary> |
| 93 | + /// In tabular input data, the last row (indexed by 0) to use. Defaults to the last row containing data. |
| 94 | + /// Default: undefined |
| 95 | + /// </summary> |
| 96 | + public Number? EndRow { get; set; } |
| 97 | + |
| 98 | + /// <summary> |
| 99 | + /// Whether to use the first row in the data set as series names. |
| 100 | + /// Default: true |
| 101 | + /// </summary> |
| 102 | + public bool? FirstRowAsNames { get; set; } |
| 103 | + |
| 104 | + /// <summary> |
| 105 | + /// The key for a Google Spreadsheet to load. See general information on GS. |
| 106 | + /// Default: undefined |
| 107 | + /// </summary> |
| 108 | + public string GoogleSpreadsheetKey { get; set; } |
| 109 | + |
| 110 | + /// <summary> |
| 111 | + /// The Google Spreadsheet worksheet to use in combination with googleSpreadsheetKey. The available id's from your sheet can be read from https://spreadsheets.google.com/feeds/worksheets/{key}/public/basic. |
| 112 | + /// Default: undefined |
| 113 | + /// </summary> |
| 114 | + public string GoogleSpreadsheetWorksheet { get; set; } |
| 115 | + |
| 116 | + /// <summary> |
| 117 | + /// Item or cell delimiter for parsing CSV. Defaults to the tab character \t if a tab character is found in the CSV string, if not it defaults to ,. |
| 118 | + /// If this is set to false or undefined, the parser will attempt to deduce the delimiter automatically. |
| 119 | + /// Default: undefined |
| 120 | + /// </summary> |
| 121 | + public string ItemDelimiter { get; set; } |
| 122 | + |
| 123 | + /// <summary> |
| 124 | + /// Line delimiter for parsing CSV. |
| 125 | + /// Default: \n |
| 126 | + /// </summary> |
| 127 | + public string LineDelimiter { get; set; } |
| 128 | + |
| 129 | + /// <summary> |
| 130 | + /// A callback function to access the parsed columns, the two-dimentional input data array directly, before they are interpreted into series data and categories. Return false to stop completion, or call this.complete() to continue async. |
| 131 | + /// Default: undefined |
| 132 | + /// </summary> |
| 133 | + [JsonFormatter("{0)")] |
| 134 | + public string Parsed { get; set; } |
| 135 | + |
| 136 | + /// <summary> |
| 137 | + /// A callback function to parse string representations of dates into JavaScript timestamps. Should return an integer timestamp on success. |
| 138 | + /// Default: undefined |
| 139 | + /// </summary> |
| 140 | + [JsonFormatter("{0)")] |
| 141 | + public string ParseDate { get; set; } |
| 142 | + |
| 143 | + /// <summary> |
| 144 | + /// The same as the columns input option, but defining rows intead of columns. |
| 145 | + /// Default: undefined |
| 146 | + /// </summary> |
| 147 | + public object[,] Rows { get; set; } |
| 148 | + |
| 149 | + /// <summary> |
| 150 | + /// A URL to a remote JSON dataset, structured as a row array. Will be fetched when the chart is created using Ajax. |
| 151 | + /// Default: undefined |
| 152 | + /// </summary> |
| 153 | + public string RowsURL { get; set; } |
| 154 | + |
| 155 | + /// <summary> |
| 156 | + /// An array containing object with Point property names along with what column id the property should be taken from. |
| 157 | + /// Default: undefined |
| 158 | + /// </summary> |
| 159 | + public object[] SeriesMapping { get; set; } |
| 160 | + |
| 161 | + /// <summary> |
| 162 | + /// In tabular input data, the first column (indexed by 0) to use. |
| 163 | + /// Default: 0 |
| 164 | + /// </summary> |
| 165 | + public Number? StartColumn { get; set; } |
| 166 | + |
| 167 | + /// <summary> |
| 168 | + /// In tabular input data, the first row (indexed by 0) to use. |
| 169 | + /// Default: 0 |
| 170 | + /// </summary> |
| 171 | + public Number? StartRow { get; set; } |
| 172 | + |
| 173 | + /// <summary> |
| 174 | + /// Switch rows and columns of the input data, so that this.columns effectively becomes the rows of the data set, and the rows are interpreted as series. |
| 175 | + /// Default: false |
| 176 | + /// </summary> |
| 177 | + public bool? SwitchRowsAndColumns { get; set; } |
| 178 | + |
| 179 | + /// <summary> |
| 180 | + /// An HTML table or the id of such to be parsed as input data. Related options are startRow, endRow, startColumn and endColumn to delimit what part of the table is used. |
| 181 | + /// Default: undefined |
| 182 | + /// </summary> |
| 183 | + public string Table { get; set; } |
| 184 | + } |
| 185 | +} |
0 commit comments