Skip to content

Commit c204873

Browse files
author
Anton Chengaev
committed
DVF-4386 textShadow setting
1 parent 9d50318 commit c204873

File tree

40 files changed

+1958
-10
lines changed

40 files changed

+1958
-10
lines changed

core/StateSettings.adoc

Lines changed: 30 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2163,6 +2163,35 @@ anychart.core.StateSettings.prototype.fontColor;
21632163
*/
21642164
anychart.core.StateSettings.prototype.fontColor;
21652165
2166+
2167+
//----------------------------------------------------------------------------------------------------------------------
2168+
//
2169+
// anychart.core.StateSettings.prototype.textShadow
2170+
//
2171+
//----------------------------------------------------------------------------------------------------------------------
2172+
2173+
/**
2174+
* Getter for text shadow settings.
2175+
* @shortDescription Text shadow settings.
2176+
* @category Text Settings
2177+
* @listing See listing
2178+
* var state = annotation.normal();
2179+
* var textShadow = state.textShadow();
2180+
* @return {string} String representation of text shadow.
2181+
* @since 8.7.2
2182+
*/
2183+
anychart.core.StateSettings.prototype.textShadow;
2184+
2185+
/**
2186+
* Setter for the text shadow settings.
2187+
* @example anychart.core.StateSettings.textShadow
2188+
* @param {anychart.graphics.vector.TextShadow|string} opt_textShadow ['none'] Text shadow to set.
2189+
* @return {anychart.core.StateSettings} Self instance for method chaining.
2190+
* @since 8.7.2
2191+
*/
2192+
anychart.core.StateSettings.prototype.textShadow;
2193+
2194+
21662195
//----------------------------------------------------------------------------------------------------------------------
21672196
//
21682197
// anychart.core.StateSettings.prototype.connector
@@ -3151,4 +3180,4 @@ anychart.core.StateSettings.prototype.background;
31513180
* @param {(string|Object|null|boolean)=} opt_settings Background settings to set.
31523181
* @return {anychart.core.StateSettings} Self instance for method chaining.
31533182
*/
3154-
anychart.core.StateSettings.prototype.background;
3183+
anychart.core.StateSettings.prototype.background;

core/Text.adoc

Lines changed: 27 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ anychart.core.Text.prototype.textSettings;
5555
* 'textOverflow': smth,
5656
* 'selectable': smth,
5757
* 'useHtml': smth
58+
* 'textShadow':smth
5859
* }</pre>
5960
* @return {anychart.core.Text} Self instance for method chaining.
6061
*/
@@ -144,6 +145,31 @@ anychart.core.Text.prototype.fontColor;
144145
anychart.core.Text.prototype.fontColor;
145146
146147
148+
149+
//----------------------------------------------------------------------------------------------------------------------
150+
//
151+
// anychart.core.Text.prototype.textShadow
152+
//
153+
//----------------------------------------------------------------------------------------------------------------------
154+
155+
/**
156+
* Getter for the text shadow.
157+
* @shortDescription Text shadow settings.
158+
* @category Base Text Settings
159+
* @example anychart.core.Text.textShadow_get
160+
* @return {string} String representation of text shadow.
161+
*/
162+
anychart.core.Text.prototype.textShadow;
163+
164+
/**
165+
* Setter for the text shadow.<br/>
166+
* @example anychart.core.Text.textShadow_set
167+
* @param {anychart.graphics.vector.TextShadow|string} opt_textShadow ['none'] Text shadow to set.
168+
* @return {anychart.core.Text} Self instance for method chaining.
169+
*/
170+
anychart.core.Text.prototype.textShadow;
171+
172+
147173
//----------------------------------------------------------------------------------------------------------------------
148174
//
149175
// anychart.core.Text.prototype.fontOpacity
@@ -565,4 +591,4 @@ anychart.core.Text.prototype.useHtml;
565591
anychart.core.Text.prototype.zIndex;
566592
567593
/** @inheritDoc */
568-
anychart.core.Text.prototype.enabled;
594+
anychart.core.Text.prototype.enabled;
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="ac:name" content="anychart.core.StateSettings.textShadow"/>
6+
<meta name="ac:short-desc" content=""/>
7+
<meta name="ac:desc" content=""/>
8+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-base.min.js"></script>
9+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-annotations.min.js"></script>
10+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-exports.min.js"></script>
11+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-ui.min.js"></script>
12+
<link rel="stylesheet" type="text/css" href="https://cdn.anychart.com/releases/{{branch-name}}/css/anychart-ui.min.css"/>
13+
<style>
14+
html, body, #container {
15+
width: 100%;
16+
height: 100%;
17+
margin: 0;
18+
padding: 0;
19+
}
20+
</style>
21+
</head>
22+
<body>
23+
<div id="container"></div>
24+
<script>
25+
anychart.onDocumentReady(function () {
26+
var chart = anychart.area([
27+
{x: 0, value: 864},
28+
{x: 10, value: 754},
29+
{x: 20, value: 742},
30+
{x: 30, value: 837},
31+
{x: 40, value: 801},
32+
{x: 50, value: 706},
33+
{x: 60, value: 753},
34+
{x: 70, value: 816},
35+
{x: 80, value: 734},
36+
{x: 90, value: 745},
37+
{x: 100, value: 853},
38+
]);
39+
40+
chart.yScale({minimum: 500});
41+
chart.xScale({type: 'linear', ticks: {interval: 10}, maximum: 100});
42+
43+
var controller = chart.annotations();
44+
45+
var annotation = controller.label();
46+
annotation.valueAnchor(706);
47+
annotation.xAnchor(50);
48+
annotation.text('Minimum elevation');
49+
annotation.anchor('center-top');
50+
51+
var state = annotation.normal();
52+
53+
// Set font color.
54+
state.textShadow('3px 3px 2px black');
55+
56+
chart.title('Set font color');
57+
chart.container('container');
58+
chart.draw();
59+
});
60+
</script>
61+
</body>
62+
</html>
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="ac:name" content="anychart.core.Text.textShadow get"/>
6+
<meta name="ac:short-desc" content=""/>
7+
<meta name="ac:desc" content=""/>
8+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-base.min.js"></script>
9+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-exports.min.js"></script>
10+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-ui.min.js"></script>
11+
<link rel="stylesheet" type="text/css" href="https://cdn.anychart.com/releases/{{branch-name}}/css/anychart-ui.min.css"/>
12+
<style>
13+
html, body, #container {
14+
width: 100%;
15+
height: 100%;
16+
margin: 0;
17+
padding: 0;
18+
}
19+
</style>
20+
</head>
21+
<body>
22+
<div id="container"></div>
23+
<script>
24+
anychart.onDocumentReady(function () {
25+
var chart = anychart.line([
26+
{x: 'Cycling', value: 18},
27+
{x: 'Swimming', value: 25},
28+
{x: 'Run', value: 10},
29+
{x: 'Hiking', value: 20}
30+
]);
31+
32+
var title = chart.title();
33+
title.enabled(true);
34+
35+
// Gets text font color.
36+
var textShadow = title.textShadow();
37+
38+
title.text('The font color is ' + textShadow);
39+
40+
chart.container('container');
41+
chart.draw();
42+
});
43+
</script>
44+
</body>
45+
</html>
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="ac:name" content="anychart.core.Text.textShadow set"/>
6+
<meta name="ac:short-desc" content=""/>
7+
<meta name="ac:desc" content=""/>
8+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-base.min.js"></script>
9+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-exports.min.js"></script>
10+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-ui.min.js"></script>
11+
<link rel="stylesheet" type="text/css" href="https://cdn.anychart.com/releases/{{branch-name}}/css/anychart-ui.min.css"/>
12+
<style>
13+
html, body, #container {
14+
width: 100%;
15+
height: 100%;
16+
margin: 0;
17+
padding: 0;
18+
}
19+
</style>
20+
</head>
21+
<body>
22+
<div id="container"></div>
23+
<script>
24+
anychart.onDocumentReady(function () {
25+
var chart = anychart.line([
26+
{x: 'Cycling', value: 18},
27+
{x: 'Swimming', value: 25},
28+
{x: 'Run', value: 10},
29+
{x: 'Hiking', value: 20}
30+
]);
31+
32+
var title = chart.title();
33+
title.enabled(true);
34+
title.text('Set text font color');
35+
36+
// Set text font color.
37+
title.textShadow('3px 3px 2px black');
38+
39+
chart.container('container');
40+
chart.draw();
41+
});
42+
</script>
43+
</body>
44+
</html>

core/annotations/Label.adoc

Lines changed: 29 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,34 @@ anychart.core.annotations.Label.prototype.fontColor;
213213
*/
214214
anychart.core.annotations.Label.prototype.fontColor;
215215
216+
217+
//----------------------------------------------------------------------------------------------------------------------
218+
//
219+
// anychart.core.annotations.Label.prototype.textShadow
220+
//
221+
//----------------------------------------------------------------------------------------------------------------------
222+
223+
/**
224+
* Getter for text shadow settings.
225+
* @shortDescription Text shadow settings.
226+
* @category Content Text Settings
227+
* @listing See listing
228+
* var textShadow = annotation.textShadow();
229+
* @return {string} String representation of text shadow.
230+
* @since 8.7.2
231+
*/
232+
anychart.core.annotations.Label.prototype.textShadow;
233+
234+
/**
235+
* Setter for text shadow settings.
236+
* @example anychart.core.annotations.Label.textShadow
237+
* @param {anychart.graphics.vector.TextShadow|string} opt_textShadow ['none'] Text shadow to set.
238+
* @return {anychart.core.annotations.Label} Self instance for method chaining.
239+
* @since 8.7.2
240+
*/
241+
anychart.core.annotations.Label.prototype.textShadow;
242+
243+
216244
//----------------------------------------------------------------------------------------------------------------------
217245
//
218246
// anychart.core.annotations.Label.prototype.fontDecoration
@@ -963,4 +991,4 @@ anychart.core.annotations.Label.prototype.xScale;
963991
anychart.core.annotations.Label.prototype.yScale;
964992
965993
/** @inheritDoc */
966-
anychart.core.annotations.Label.prototype.zIndex;
994+
anychart.core.annotations.Label.prototype.zIndex;
Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
<!DOCTYPE html>
2+
<html>
3+
<head>
4+
<meta charset="UTF-8">
5+
<meta name="ac:name" content="anychart.core.annotations.Label.textShadow"/>
6+
<meta name="ac:short-desc" content=""/>
7+
<meta name="ac:desc" content=""/>
8+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-base.min.js"></script>
9+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-annotations.min.js"></script>
10+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-exports.min.js"></script>
11+
<script src="https://cdn.anychart.com/releases/{{branch-name}}/js/anychart-ui.min.js"></script>
12+
13+
<link rel="stylesheet" type="text/css" href="https://cdn.anychart.com/releases/{{branch-name}}/css/anychart-ui.min.css"/>
14+
15+
<style>
16+
html, body, #container {
17+
width: 100%;
18+
height: 100%;
19+
margin: 0;
20+
padding: 0;
21+
}
22+
</style>
23+
</head>
24+
<body>
25+
<div id="container"></div>
26+
<script>
27+
anychart.onDocumentReady(function () {
28+
var chart = anychart.area([
29+
{x: 0, value: 864},
30+
{x: 10, value: 754},
31+
{x: 20, value: 742},
32+
{x: 30, value: 837},
33+
{x: 40, value: 801},
34+
{x: 50, value: 706},
35+
{x: 60, value: 753},
36+
{x: 70, value: 816},
37+
{x: 80, value: 734},
38+
{x: 90, value: 745},
39+
{x: 100, value: 853}
40+
]);
41+
42+
chart.yScale({minimum: 500});
43+
chart.xScale({type: 'linear', ticks: {interval: 10}, maximum: 100});
44+
45+
var controller = chart.annotations();
46+
47+
var annotation = controller.label();
48+
annotation.valueAnchor(706);
49+
annotation.xAnchor(50);
50+
annotation.text('Minimum elevation');
51+
annotation.anchor('center-top');
52+
53+
// Set font color.
54+
annotation.textShadow('3px 3px 2px black');
55+
56+
chart.title('Set font color');
57+
chart.container('container');
58+
chart.draw();
59+
});
60+
</script>
61+
</body>
62+
</html>

core/axisMarkers/Text.adoc

Lines changed: 28 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -654,6 +654,33 @@ anychart.core.axisMarkers.Text.prototype.fontColor;
654654
*/
655655
anychart.core.axisMarkers.Text.prototype.fontColor;
656656
657+
658+
//----------------------------------------------------------------------------------------------------------------------
659+
//
660+
// anychart.core.axisMarkers.Text.prototype.textShadow
661+
//
662+
//----------------------------------------------------------------------------------------------------------------------
663+
664+
/**
665+
* Getter for the text shadow.
666+
* @shortDescription Text shadow settings.
667+
* @category Base Text Settings
668+
* @listing See listing
669+
* var textMarker = chart.textMarker();
670+
* var textShadow = textMarker.textShadow();
671+
* @return {string} String representation of text shadow.
672+
*/
673+
anychart.core.axisMarkers.Text.prototype.textShadow;
674+
675+
/**
676+
* Setter for the text shadow.<br/>
677+
* @example anychart.core.axisMarkers.Text.textShadow
678+
* @param {anychart.graphics.vector.TextShadow|string} opt_textShadow ['none'] Text shadow to set.
679+
* @return {anychart.core.axisMarkers.Text} Self instance for method chaining.
680+
*/
681+
anychart.core.axisMarkers.Text.prototype.textShadow;
682+
683+
657684
//----------------------------------------------------------------------------------------------------------------------
658685
//
659686
// anychart.core.axisMarkers.Text.prototype.fontOpacity
@@ -802,4 +829,4 @@ anychart.core.axisMarkers.Text.prototype.selectable;
802829
anychart.core.axisMarkers.Text.prototype.disablePointerEvents;
803830
804831
/** @inheritDoc */
805-
anychart.core.axisMarkers.Text.prototype.enabled;
832+
anychart.core.axisMarkers.Text.prototype.enabled;

0 commit comments

Comments
 (0)