@@ -53,6 +53,53 @@ export class PlotHelper {
5353 return _options ;
5454 }
5555
56+ public get linestyle_dashed ( ) {
57+ return 'linestyle_dashed' ;
58+ }
59+ public get linestyle_dotted ( ) {
60+ return 'linestyle_dotted' ;
61+ }
62+ public get linestyle_solid ( ) {
63+ return 'linestyle_solid' ;
64+ }
65+ public get style_area ( ) {
66+ return 'style_area' ;
67+ }
68+ public get style_areabr ( ) {
69+ return 'style_areabr' ;
70+ }
71+ public get style_circles ( ) {
72+ return 'style_circles' ;
73+ }
74+ public get style_columns ( ) {
75+ return 'style_columns' ;
76+ }
77+ public get style_cross ( ) {
78+ return 'style_cross' ;
79+ }
80+ public get style_histogram ( ) {
81+ return 'style_histogram' ;
82+ }
83+ public get style_line ( ) {
84+ return 'style_line' ;
85+ }
86+ public get style_linebr ( ) {
87+ return 'style_linebr' ;
88+ }
89+ public get style_stepline ( ) {
90+ return 'style_stepline' ;
91+ }
92+ public get style_stepline_diamond ( ) {
93+ return 'style_stepline_diamond' ;
94+ }
95+ public get style_steplinebr ( ) {
96+ return 'style_steplinebr' ;
97+ }
98+
99+ param ( source : any , index : number = 0 , name ?: string ) {
100+ return Series . from ( source ) . get ( index ) ;
101+ }
102+
56103 //in the current implementation, plot functions are only used to collect data for the plots array and map it to the market data
57104 plotchar ( ...args ) {
58105 // if (!this.context.plots[title]) {
@@ -64,10 +111,12 @@ export class PlotHelper {
64111 // value: value,
65112 // options: { ...this.extractPlotOptions(options), style: 'char' },
66113 // });
67- this . plot ( ...args ) ;
114+ this . any ( ...args ) ;
68115 }
69116
70- plot ( ...args ) {
117+ //this will map to plot() - see README.md for more details
118+
119+ any ( ...args ) {
71120 const _parsed = parseArgsForPineParams < PlotOptions > ( args , PLOT_SIGNATURE , PLOT_ARGS_TYPES ) ;
72121 const { series, title, ...others } = _parsed ;
73122 const options = this . extractPlotOptions ( others ) ;
@@ -156,6 +205,7 @@ export class HlineHelper {
156205
157206 //this will map to hline()
158207 any ( price , title , color , linestyle , linewidth , editable , display ) {
159- return this . context . pine . plot ( price , { title, color, linestyle, linewidth, editable, display } ) ;
208+ //plot.any is mapped to plot() at runtime
209+ return this . context . pine . plot . any ( price , { title, color, linestyle, linewidth, editable, display } ) ;
160210 }
161211}
0 commit comments