Skip to content

Commit

Permalink
3.20.10
Browse files Browse the repository at this point in the history
  • Loading branch information
martynasma committed Jul 29, 2016
1 parent 944a80a commit 7994d12
Show file tree
Hide file tree
Showing 8 changed files with 294 additions and 271 deletions.
381 changes: 191 additions & 190 deletions amcharts/amcharts.js

Large diffs are not rendered by default.

94 changes: 47 additions & 47 deletions amcharts/amstock.js

Large diffs are not rendered by default.

15 changes: 12 additions & 3 deletions amcharts/plugins/export/README.md
@@ -1,6 +1,6 @@
# amCharts Export

Version: 1.4.30
Version: 1.4.33


## Description
Expand Down Expand Up @@ -600,7 +600,7 @@ your exported images.
top: 50,
left: 100,
family: this.setup.chart.fontFamily,
size: this.setup.chart.fontSize * 2
fontSize: this.setup.chart.fontSize * 2
});
this.setup.fabric.add(text);
},
Expand All @@ -615,7 +615,7 @@ your exported images.
top: 50,
left: 100,
family: this.setup.chart.fontFamily,
size: this.setup.chart.fontSize * 2
fontSize: this.setup.chart.fontSize * 2
});
this.setup.fabric.add(text);
}
Expand Down Expand Up @@ -971,6 +971,15 @@ http://www.apache.org/licenses/LICENSE-2.0

## Changelog

### 1.4.33
* Fixed: fill/stroke polyfilling issue on svg elements with color validation/preparation for fabric

### 1.4.32
* Fixed: Issue polyfilling the color attributes with "rgba" color codes

### 1.4.31
* Changed: Included independent IE detection to handle specific IE10, IE11 svg image in canvas issue

### 1.4.30
* Fixed: Pattern loading, positioning issue, supports x,y offset now

Expand Down
59 changes: 36 additions & 23 deletions amcharts/plugins/export/export.js
Expand Up @@ -2,7 +2,7 @@
Plugin Name: amCharts Export
Description: Adds export capabilities to amCharts products
Author: Benjamin Maertz, amCharts
Version: 1.4.30
Version: 1.4.33
Author URI: http://www.amcharts.com/
Copyright 2016 amCharts
Expand Down Expand Up @@ -70,7 +70,7 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
AmCharts[ "export" ] = function( chart, config ) {
var _this = {
name: "export",
version: "1.4.30",
version: "1.4.33",
libs: {
async: true,
autoLoad: true,
Expand All @@ -91,7 +91,9 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
setup: {
chart: chart,
hasBlob: false,
wrapper: false
wrapper: false,
isIE: !!window.document.documentMode,
IEversion: window.document.documentMode
},
drawing: {
enabled: false,
Expand Down Expand Up @@ -241,7 +243,7 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
}

// APPLY OPACITY ON CURRENT COLOR
rgba = new fabric.Color( _this.drawing.color ).getSource();
rgba = _this.getRGBA( _this.drawing.color );
rgba.pop();
rgba.push( _this.drawing.opacity );
_this.drawing.color = "rgba(" + rgba.join() + ")";
Expand All @@ -259,7 +261,7 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
cfg.opacity = cfg.opacity || state.opacity;
cfg.fontSize = cfg.fontSize || cfg.width * 3;

rgba = new fabric.Color( cfg.color ).getSource();
rgba = _this.getRGBA( cfg.color );
rgba.pop();
rgba.push( cfg.opacity );
cfg.color = "rgba(" + rgba.join() + ")";
Expand Down Expand Up @@ -865,7 +867,7 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
return true;

// IE 10 internal bug handling SVG images in canvas context
} else if ( AmCharts.isIE && AmCharts.IEversion == 10 && source.toLowerCase().indexOf( ".svg" ) != -1 ) {
} else if ( _this.setup.isIE && ( _this.setup.IEversion == 10 || _this.setup.IEversion == 11 ) && source.toLowerCase().indexOf( ".svg" ) != -1 ) {
return true;
}
}
Expand Down Expand Up @@ -906,7 +908,7 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
}

// CHECK IE; ATTEMPT TO ACCESS HEAD ELEMENT
if ( AmCharts.isIE && AmCharts.IEversion <= 9 ) {
if ( _this.setup.isIE && _this.setup.IEversion <= 9 ) {
if ( !Array.prototype.indexOf || !document.head || _this.config.fallback === false ) {
return false;
}
Expand Down Expand Up @@ -1059,25 +1061,37 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
} else {
var attrs = [ "fill", "stroke" ];
for ( i2 = 0; i2 < attrs.length; i2++ ) {
var attr = attrs[ i2 ]
var attrVal = String( childNode.getAttribute( attr ) || "none" );

// CHECk VALUE AGAINST BLACKLIST
if ( [ "none", "transparent" ].indexOf( attrVal ) == -1 && !_this.isHashbanged( attrVal ) ) {
var attrRGBA = fabric.Color.fromHex( attrVal ).getSource();

// ENOUGH IS ENOUGH, SOMETHING IS WRONG, LETS RESET IT
if ( attrRGBA === undefined ) {
childNode.setAttribute( attr, "none" );
childNode.setAttribute( attr + "-opacity", "0" );
}
var attr = attrs[ i2 ];
var attrVal = childNode.getAttribute( attr );
var attrRGBA = _this.getRGBA( attrVal );

// VALIDATE AND RESET UNKNOWN COLORS (avoids fabric to crash)
if ( attrVal && !attrRGBA ) {
childNode.setAttribute( attr, "none" );
childNode.setAttribute( attr + "-opacity", "0" );
}
}
}
}
return group;
},

/*
** GET RGBA COLOR ARRAY FROM INPUT
*/
getRGBA: function( source, returnInstance ) {

if ( source != "none" && source != "transparent" && !_this.isHashbanged( source ) ) {
source = new fabric.Color( source );

if ( source._source ) {
return returnInstance ? source : source.getSource();
}
}

return false;
},

/*
** GATHER MOUSE POSITION;
*/
Expand Down Expand Up @@ -1920,7 +1934,7 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
var attr = attrs[ i1 ]
var attrVal = String( svg.getAttribute( attr ) || "none" );
var attrOpacity = Number( svg.getAttribute( attr + "-opacity" ) || "1" );
var attrRGBA = fabric.Color.fromHex( attrVal ).getSource();
var attrRGBA = _this.getRGBA( attrVal );

if ( attrRGBA ) {
attrRGBA.pop();
Expand Down Expand Up @@ -2066,8 +2080,8 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
var value = pair[ 1 ];

if ( [ "fill", "stroke" ].indexOf( key ) != -1 ) {
value = fabric.Color.fromRgba( value );
if ( value && value._source ) {
value = _this.getRGBA( value, true );
if ( value ) {
var color = "#" + value.toHex();
var opacity = value._source[ 3 ];

Expand Down Expand Up @@ -3594,5 +3608,4 @@ if ( !AmCharts.translations[ "export" ][ "en" ] ) {
*/
AmCharts.addInitHandler( function( chart ) {
new AmCharts[ "export" ]( chart );

}, [ "pie", "serial", "xy", "funnel", "radar", "gauge", "stock", "map", "gantt" ] );
4 changes: 2 additions & 2 deletions amcharts/plugins/export/export.min.js

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions amcharts/serial.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
@@ -1,6 +1,6 @@
{
"name": "amstock3",
"version": "3.20.9",
"version": "3.20.10",
"description": "JavaScript Stock Chart V3",
"main": "amcharts/amcharts.js",
"repository": {
Expand Down
2 changes: 1 addition & 1 deletion samples/_usingThemes.html
Expand Up @@ -94,7 +94,7 @@
document.body.style.backgroundImage = "url(" + bgImage + ")";
}

AmCharts.makeChart("chartdiv", {
chart = AmCharts.makeChart("chartdiv", {
type: "stock",
theme: theme,

Expand Down

0 comments on commit 7994d12

Please sign in to comment.