Skip to content

Commit

Permalink
feat: labelFontFamily (#358)
Browse files Browse the repository at this point in the history
  • Loading branch information
cpsievert authored Feb 10, 2021
1 parent ac0753f commit 80ab22e
Show file tree
Hide file tree
Showing 5 changed files with 35 additions and 23 deletions.
18 changes: 11 additions & 7 deletions dist/justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
// color of label showing label under value
labelFontColor: kvLookup('labelFontColor', config, dataset, "#b3b3b3"),

// valueFontFamily : string
// font-family for label as well as min/max value
labelFontFamily: kvLookup('labelFontFamily', config, dataset, "Arial"),

// shadowOpacity : int
// 0 ~ 1
shadowOpacity: kvLookup('shadowOpacity', config, dataset, 0.2),
Expand Down Expand Up @@ -649,7 +653,7 @@
obj.txtLabel.attr({
"font-size": obj.params.labelFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": "0"
});
Expand All @@ -673,7 +677,7 @@
obj.txtMin.attr({
"font-size": obj.params.minFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": (obj.config.hideMinMax || obj.config.donut) ? "0" : "1"
});
Expand All @@ -696,7 +700,7 @@
obj.txtMax.attr({
"font-size": obj.params.maxFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": (obj.config.hideMinMax || obj.config.donut) ? "0" : "1"
});
Expand Down Expand Up @@ -761,7 +765,7 @@
setDy(obj.txtValue, obj.params.valueFontSize, obj.params.valueY);
};


this.bindEvent("raphael.anim.finish", onFinish)
this.bindEvent("raphael.anim.frame", onFrame)

Expand Down Expand Up @@ -812,12 +816,12 @@
eventName += '.' + this.level.id

//check for existing bind events
if(this.events[eventName])
if(this.events[eventName])
Raphael.eve.off(eventName, this.events[eventName])

Raphael.eve.on(eventName, func);

this.events[eventName] = func
this.events[eventName] = func
}


Expand Down
2 changes: 1 addition & 1 deletion dist/justgage.min.js

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion dist/justgage.min.js.map

Large diffs are not rendered by default.

18 changes: 11 additions & 7 deletions docs/justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
// color of label showing label under value
labelFontColor: kvLookup('labelFontColor', config, dataset, "#b3b3b3"),

// valueFontFamily : string
// font-family for label as well as min/max value
labelFontFamily: kvLookup('labelFontFamily', config, dataset, "Arial"),

// shadowOpacity : int
// 0 ~ 1
shadowOpacity: kvLookup('shadowOpacity', config, dataset, 0.2),
Expand Down Expand Up @@ -649,7 +653,7 @@
obj.txtLabel.attr({
"font-size": obj.params.labelFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": "0"
});
Expand All @@ -673,7 +677,7 @@
obj.txtMin.attr({
"font-size": obj.params.minFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": (obj.config.hideMinMax || obj.config.donut) ? "0" : "1"
});
Expand All @@ -696,7 +700,7 @@
obj.txtMax.attr({
"font-size": obj.params.maxFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": (obj.config.hideMinMax || obj.config.donut) ? "0" : "1"
});
Expand Down Expand Up @@ -761,7 +765,7 @@
setDy(obj.txtValue, obj.params.valueFontSize, obj.params.valueY);
};


this.bindEvent("raphael.anim.finish", onFinish)
this.bindEvent("raphael.anim.frame", onFrame)

Expand Down Expand Up @@ -812,12 +816,12 @@
eventName += '.' + this.level.id

//check for existing bind events
if(this.events[eventName])
if(this.events[eventName])
Raphael.eve.off(eventName, this.events[eventName])

Raphael.eve.on(eventName, func);

this.events[eventName] = func
this.events[eventName] = func
}


Expand Down
18 changes: 11 additions & 7 deletions justgage.js
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,10 @@
// color of label showing label under value
labelFontColor: kvLookup('labelFontColor', config, dataset, "#b3b3b3"),

// valueFontFamily : string
// font-family for label as well as min/max value
labelFontFamily: kvLookup('labelFontFamily', config, dataset, "Arial"),

// shadowOpacity : int
// 0 ~ 1
shadowOpacity: kvLookup('shadowOpacity', config, dataset, 0.2),
Expand Down Expand Up @@ -649,7 +653,7 @@
obj.txtLabel.attr({
"font-size": obj.params.labelFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": "0"
});
Expand All @@ -673,7 +677,7 @@
obj.txtMin.attr({
"font-size": obj.params.minFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": (obj.config.hideMinMax || obj.config.donut) ? "0" : "1"
});
Expand All @@ -696,7 +700,7 @@
obj.txtMax.attr({
"font-size": obj.params.maxFontSize,
"font-weight": "normal",
"font-family": "Arial",
"font-family": obj.config.labelFontFamily,
"fill": obj.config.labelFontColor,
"fill-opacity": (obj.config.hideMinMax || obj.config.donut) ? "0" : "1"
});
Expand Down Expand Up @@ -761,7 +765,7 @@
setDy(obj.txtValue, obj.params.valueFontSize, obj.params.valueY);
};


this.bindEvent("raphael.anim.finish", onFinish)
this.bindEvent("raphael.anim.frame", onFrame)

Expand Down Expand Up @@ -812,12 +816,12 @@
eventName += '.' + this.level.id

//check for existing bind events
if(this.events[eventName])
if(this.events[eventName])
Raphael.eve.off(eventName, this.events[eventName])

Raphael.eve.on(eventName, func);

this.events[eventName] = func
this.events[eventName] = func
}


Expand Down

0 comments on commit 80ab22e

Please sign in to comment.