You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by wa...@apache.org on 2024/11/09 08:27:44 UTC

(echarts) branch feat/calendar-label-silent created (now 61f2e846d)

This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a change to branch feat/calendar-label-silent
in repository https://gitbox.apache.org/repos/asf/echarts.git


      at 61f2e846d feat(calendar): add `silent` option for `dayLabel`/`monthLabel`/yearLabel`.

This branch includes the following new commits:

     new 61f2e846d feat(calendar): add `silent` option for `dayLabel`/`monthLabel`/yearLabel`.

The 1 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org


(echarts) 01/01: feat(calendar): add `silent` option for `dayLabel`/`monthLabel`/yearLabel`.

Posted by wa...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

wangzx pushed a commit to branch feat/calendar-label-silent
in repository https://gitbox.apache.org/repos/asf/echarts.git

commit 61f2e846d99579213d0e3b22a9b5962d296b263d
Author: plainheart <yh...@all-my-life.cn>
AuthorDate: Sat Nov 9 16:27:16 2024 +0800

    feat(calendar): add `silent` option for `dayLabel`/`monthLabel`/yearLabel`.
---
 src/component/calendar/CalendarView.ts | 13 ++++++++++---
 test/calendar-simple.html              | 11 ++++++++++-
 2 files changed, 20 insertions(+), 4 deletions(-)

diff --git a/src/component/calendar/CalendarView.ts b/src/component/calendar/CalendarView.ts
index 6cc727475..01a84b218 100644
--- a/src/component/calendar/CalendarView.ts
+++ b/src/component/calendar/CalendarView.ts
@@ -337,7 +337,8 @@ class CalendarView extends ComponentView {
             z2: 30,
             style: createTextStyle(yearLabel, {
                 text: content
-            })
+            }),
+            silent: yearLabel.get('silent')
         });
         yearText.attr(this._yearTextPositionControl(yearText, posPoints[pos], orient, pos, margin));
 
@@ -422,6 +423,8 @@ class CalendarView extends ComponentView {
         margin = pos === 'start' ? -margin : margin;
         const isCenter = (align === 'center');
 
+        const labelSilent = monthLabel.get('silent');
+
         for (let i = 0; i < termPoints[idx].length - 1; i++) {
 
             const tmp = termPoints[idx][i].slice();
@@ -449,7 +452,8 @@ class CalendarView extends ComponentView {
                 style: extend(
                     createTextStyle(monthLabel, {text: content}),
                     this._monthTextPositionControl(tmp, isCenter, orient, pos, margin)
-                )
+                ),
+                silent: labelSilent
             });
 
             group.add(monthText);
@@ -533,6 +537,8 @@ class CalendarView extends ComponentView {
             margin = -margin;
         }
 
+        const labelSilent = dayLabel.get('silent');
+
         for (let i = 0; i < 7; i++) {
 
             const tmpD = coordSys.getNextNDay(start, i);
@@ -544,7 +550,8 @@ class CalendarView extends ComponentView {
                 style: extend(
                     createTextStyle(dayLabel, {text: nameMap[day]}),
                     this._weekTextPositionControl(point, orient, pos, margin, cellSize)
-                )
+                ),
+                silent: labelSilent
             });
 
             group.add(weekText);
diff --git a/test/calendar-simple.html b/test/calendar-simple.html
index ecaa3a3d2..1cf47ba53 100644
--- a/test/calendar-simple.html
+++ b/test/calendar-simple.html
@@ -73,7 +73,16 @@ under the License.
                         max: 1000
                     },
                     calendar: {
-                        range: '2017'
+                        range: '2017',
+                        dayLabel: {
+                            silent: true
+                        },
+                        monthLabel: {
+                            silent: true
+                        },
+                        yearLabel: {
+                            silent: true
+                        }
                     },
                     series: {
                         type: 'heatmap',


---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org