You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@echarts.apache.org by GitBox <gi...@apache.org> on 2020/12/21 04:15:37 UTC
[GitHub] [incubator-echarts] susiwen8 commented on a change in pull request #13848: Fix(tooltip.textStyle): fix color not working
susiwen8 commented on a change in pull request #13848:
URL: https://github.com/apache/incubator-echarts/pull/13848#discussion_r546500610
##########
File path: src/component/tooltip/tooltipMarkup.ts
##########
@@ -32,20 +32,66 @@ import { getRandomIdBase } from '../../util/number';
import Model from '../../model/Model';
import { TooltipOption } from './TooltipModel';
-
-const TOOLTIP_NAME_TEXT_STYLE_CSS = 'font-size:12px;color:#6e7079';
-const TOOLTIP_TEXT_STYLE_RICH = {
- fontSize: 12,
- fill: '#6e7079'
-};
-const TOOLTIP_VALUE_TEXT_STYLE_CSS = 'font-size:14px;color:#464646;font-weight:900';
-const TOOLTIP_VALUE_TEXT_STYLE_RICH = {
- fontSize: 14,
- fill: '#464646',
- fontWeight: 900
+type RichTextStyle = {
+ fontSize: number | string,
+ fill: string,
+ fontWeight?: number | string
};
+
+type TextStyle = string | RichTextStyle;
+
const TOOLTIP_LINE_HEIGHT_CSS = 'line-height:1';
+// TODO: more textStyle option
+function getTooltipTextStyle(
+ textStyle: TooltipOption['textStyle'],
+ renderMode: TooltipRenderMode,
+ tooltipModel?: Model<TooltipOption>
+): {
+ nameStyle: TextStyle
+ valueStyle: TextStyle
+} {
+ const nameFontColor = textStyle.color || '#6e7079';
+ const nameFontSize = textStyle.fontSize || '12px';
+ const valueFontColor = textStyle.color || '#464646';
+ const valueFontSize = textStyle.fontSize || '14px';
+ const valueFontWeight = textStyle.fontWeight || '900';
+ // const fontStyle = textStyleModel.get('fontStyle');
Review comment:
@pissang useless code has been removed
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscribe@echarts.apache.org
For additional commands, e-mail: commits-help@echarts.apache.org