File tree Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Expand file tree Collapse file tree 3 files changed +23
-4
lines changed Original file line number Diff line number Diff line change @@ -295,7 +295,10 @@ module.exports = templatedArray('shape', {
295295 valType : 'string' ,
296296 dflt : '' ,
297297 editType : 'arraydraw' ,
298- description : 'Sets the text to display with shape.'
298+ description : [
299+ 'Sets the text to display with shape.' ,
300+ 'It is also used for legend item if `name` is not provided.'
301+ ] . join ( ' ' )
299302 } ,
300303 texttemplate : shapeTexttemplateAttrs ( { } , { keys : Object . keys ( shapeLabelTexttemplateVars ) } ) ,
301304 font : fontAttrs ( {
Original file line number Diff line number Diff line change @@ -134,11 +134,22 @@ module.exports = overrideAll({
134134 '*vertical* allows vertical extend.'
135135 ] . join ( ' ' )
136136 } ,
137+
138+ name : extendFlat ( { } , basePlotAttributes . name , {
139+ description : [
140+ 'Sets new shape name.' ,
141+ 'The name appear as the legend item.'
142+ ] . join ( ' ' )
143+ } ) ,
144+
137145 label : {
138146 text : {
139147 valType : 'string' ,
140148 dflt : '' ,
141- description : 'Sets the text to display with the new shape.'
149+ description : [
150+ 'Sets the text to display with the new shape.' ,
151+ 'It is also used for legend item if `name` is not provided.'
152+ ] . join ( ' ' )
142153 } ,
143154 texttemplate : shapeTexttemplateAttrs ( { newshape : true } , { keys : Object . keys ( shapeLabelTexttemplateVars ) } ) ,
144155 font : fontAttrs ( {
Original file line number Diff line number Diff line change 36503650 },
36513651 "role": "object",
36523652 "text": {
3653- "description": "Sets the text to display with the new shape.",
3653+ "description": "Sets the text to display with the new shape. It is also used for legend item if `name` is not provided. ",
36543654 "dflt": "",
36553655 "editType": "none",
36563656 "valType": "string"
38043804 "valType": "number"
38053805 }
38063806 },
3807+ "name": {
3808+ "description": "Sets new shape name. The name appear as the legend item.",
3809+ "editType": "none",
3810+ "valType": "string"
3811+ },
38073812 "opacity": {
38083813 "description": "Sets the opacity of new shapes.",
38093814 "dflt": 1,
73797384 },
73807385 "role": "object",
73817386 "text": {
7382- "description": "Sets the text to display with shape.",
7387+ "description": "Sets the text to display with shape. It is also used for legend item if `name` is not provided. ",
73837388 "dflt": "",
73847389 "editType": "arraydraw",
73857390 "valType": "string"
You can’t perform that action at this time.
0 commit comments