-
Notifications
You must be signed in to change notification settings - Fork 99
Expand file tree
/
Copy pathBar.cs
More file actions
148 lines (145 loc) · 8.33 KB
/
Copy pathBar.cs
File metadata and controls
148 lines (145 loc) · 8.33 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
using System;
using System.Collections.Generic;
using Plotly.NET;
using Plotly.NET.LayoutObjects;
using Plotly.NET.TraceObjects;
using static Plotly.NET.StyleParam;
namespace Plotly.NET.CSharp;
public static partial class Chart
{
/// <summary>
/// Creates a bar chart, with bars plotted horizontally
///
/// A bar chart is a chart that presents categorical data with rectangular bars with heights or lengths proportional to the values that they represent.
/// </summary>
/// <param name="values">Sets the values that are plotted as the size of each bar.</param>
/// <param name="Keys">Sets the keys associated with each bar.</param>
/// <param name="MultiKeys">Sets the keys associated with each bar. Use two inner arrays here to plot multicategorial data</param>
/// <param name="Name">Sets the trace name. The trace name appear as the legend item and on hover</param>
/// <param name="ShowLegend">Determines whether or not an item corresponding to this trace is shown in the legend.</param>
/// <param name="Opacity">Sets the Opacity of the trace.</param>
/// <param name="MultiOpacity">Sets the Opacity of each individual bar.</param>
/// <param name="Text">Sets a text associated with each datum</param>
/// <param name="MultiText">Sets individual text for each datum</param>
/// <param name="MarkerColor">Sets the color of the bars</param>
/// <param name="MarkerColorScale">Sets the colorscale for the bars. To have an effect, `MarkerColor` must map to color scale values.</param>
/// <param name="MarkerOutline">Sets the color of the bar outlines</param>
/// <param name="MarkerPatternShape">Sets a pattern shape for all bars</param>
/// <param name="MultiMarkerPatternShape">Sets an individual pattern shape for each bar</param>
/// <param name="MarkerPattern">Sets the marker pattern (use this for more finegrained control than the other pattern-associated arguments).</param>
/// <param name="Marker">Sets the marker for the bars (use this for more finegrained control than the other marker-associated arguments).</param>
/// <param name="Base">Sets where the bar base is drawn (in position axis units).</param>
/// <param name="Width">Sets the bar width (in position axis units) of all bars.</param>
/// <param name="MultiWidth">Sets the individual bar width (in position axis units) for each bar.</param>
/// <param name="TextPosition">Sets the position of text associated with each datum</param>
/// <param name="MultiTextPosition">Sets the position of text associated with individual datum</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in `Defaults`</param>
public static GenericChart Bar<ValuesType, KeysType, TextType>(
IEnumerable<ValuesType> values,
Optional<IEnumerable<KeysType>> Keys = default,
Optional<IEnumerable<IEnumerable<KeysType>>> MultiKeys = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<IEnumerable<double>> MultiOpacity = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<Color> MarkerColor = default,
Optional<StyleParam.Colorscale> MarkerColorScale = default,
Optional<Line> MarkerOutline = default,
Optional<StyleParam.PatternShape> MarkerPatternShape = default,
Optional<IEnumerable<StyleParam.PatternShape>> MultiMarkerPatternShape = default,
Optional<Pattern> MarkerPattern = default,
Optional<Marker> Marker = default,
Optional<StyleParam.TextPosition> TextPosition = default,
Optional<IEnumerable<StyleParam.TextPosition>> MultiTextPosition = default,
Optional<IEnumerable<ValuesType>> MultiWidth = default,
Optional<bool> UseDefaults = default,
Optional<ValuesType> Base = default,
Optional<ValuesType> Width = default
)
where ValuesType : IConvertible
where KeysType : IConvertible
where TextType: IConvertible
=>
Plotly.NET.Chart2D_Bar.Chart.Bar<ValuesType, KeysType, TextType, ValuesType, ValuesType>(
values: values,
Keys: Keys.ToOption(),
MultiKeys: MultiKeys.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
MultiOpacity: MultiOpacity.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
MarkerColor: MarkerColor.ToOption(),
MarkerColorScale: MarkerColorScale.ToOption(),
MarkerOutline: MarkerOutline.ToOption(),
MarkerPatternShape: MarkerPatternShape.ToOption(),
MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(),
MarkerPattern: MarkerPattern.ToOption(),
Marker: Marker.ToOption(),
Base: Base.ToOption(),
Width: Width.ToOption(),
MultiWidth: MultiWidth.ToOption(),
TextPosition: TextPosition.ToOption(),
MultiTextPosition: MultiTextPosition.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
/// <summary>Creates a bar chart from encoded values, with bars plotted horizontally.</summary>
/// <param name="valuesEncoded">Sets the bar lengths as an encoded typed array.</param>
/// <param name="KeysEncoded">Sets the bar keys as an encoded typed array.</param>
/// <param name="Base">Sets where the bar base is drawn (in position axis units).</param>
/// <param name="Width">Sets the bar width (in position axis units) of all bars.</param>
/// <param name="UseDefaults">If set to false, ignore the global default settings set in <c>Defaults</c></param>
public static GenericChart Bar<TextType, BaseType, WidthType>(
EncodedTypedArray valuesEncoded,
Optional<EncodedTypedArray> KeysEncoded = default,
Optional<string> Name = default,
Optional<bool> ShowLegend = default,
Optional<double> Opacity = default,
Optional<IEnumerable<double>> MultiOpacity = default,
Optional<TextType> Text = default,
Optional<IEnumerable<TextType>> MultiText = default,
Optional<Color> MarkerColor = default,
Optional<StyleParam.Colorscale> MarkerColorScale = default,
Optional<Line> MarkerOutline = default,
Optional<StyleParam.PatternShape> MarkerPatternShape = default,
Optional<IEnumerable<StyleParam.PatternShape>> MultiMarkerPatternShape = default,
Optional<Pattern> MarkerPattern = default,
Optional<Marker> Marker = default,
Optional<BaseType> Base = default,
Optional<WidthType> Width = default,
Optional<EncodedTypedArray> MultiWidthEncoded = default,
Optional<StyleParam.TextPosition> TextPosition = default,
Optional<IEnumerable<StyleParam.TextPosition>> MultiTextPosition = default,
Optional<bool> UseDefaults = default
)
where TextType : IConvertible
where BaseType : IConvertible
where WidthType : IConvertible
=>
Plotly.NET.Chart2D_Bar.Chart.Bar(
valuesEncoded: valuesEncoded,
KeysEncoded: KeysEncoded.ToOption(),
Name: Name.ToOption(),
ShowLegend: ShowLegend.ToOption(),
Opacity: Opacity.ToOption(),
MultiOpacity: MultiOpacity.ToOption(),
Text: Text.ToOption(),
MultiText: MultiText.ToOption(),
MarkerColor: MarkerColor.ToOption(),
MarkerColorScale: MarkerColorScale.ToOption(),
MarkerOutline: MarkerOutline.ToOption(),
MarkerPatternShape: MarkerPatternShape.ToOption(),
MultiMarkerPatternShape: MultiMarkerPatternShape.ToOption(),
MarkerPattern: MarkerPattern.ToOption(),
Marker: Marker.ToOption(),
Base: Base.ToOption(),
Width: Width.ToOption(),
MultiWidthEncoded: MultiWidthEncoded.ToOption(),
TextPosition: TextPosition.ToOption(),
MultiTextPosition: MultiTextPosition.ToOption(),
UseDefaults: UseDefaults.ToOption()
);
}