Commit 78fd3f89 authored by Alexey.Musinov's avatar Alexey.Musinov

ios fixed styles for charts

parent 356b0379
...@@ -5740,34 +5740,20 @@ AscCommon.ChartPreviewManager.prototype.clearPreviews = function() ...@@ -5740,34 +5740,20 @@ AscCommon.ChartPreviewManager.prototype.clearPreviews = function()
{ {
window["native"]["DD_ClearCacheChartStyles"](); window["native"]["DD_ClearCacheChartStyles"]();
}; };
AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex) AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, type, styleIndex)
{ {
return AscFormat.ExecuteNoHistory(function(){ return AscFormat.ExecuteNoHistory(function(){
if(!this.chartsByTypes[type]) if(!this.chartsByTypes[type])
this.chartsByTypes[type] = this.getChartByType(type); this.chartsByTypes[type] = this.getChartByType(type);
var chart_space = this.chartsByTypes[type];
if(chart_space.style !== styleIndex)
{
chart_space.style = styleIndex;
chart_space.recalculateMarkers();
chart_space.recalculateSeriesColors();
chart_space.recalculatePlotAreaChartBrush();
chart_space.recalculatePlotAreaChartPen();
chart_space.recalculateChartBrush();
chart_space.recalculateChartPen();
chart_space.recalculateUpDownBars();
}
chart_space.recalculatePenBrush();
var _width_px = this.CHART_PREVIEW_WIDTH_PIX; var chart_space = this.chartsByTypes[type];
var _height_px = this.CHART_PREVIEW_WIDTH_PIX; AscFormat.ApplyPresetToChartSpace(chart_space, AscCommon.g_oChartPresets[type][styleIndex]);
if (AscCommon.AscBrowser.isRetina) chart_space.recalcInfo.recalculateReferences = false;
{ chart_space.recalculate();
_width_px <<= 1;
_height_px <<= 1;
}
window["native"]["DD_StartNativeDraw"](_width_px, _height_px, 50, 50); // sizes for imageView
window["native"]["DD_StartNativeDraw"](85 * 2, 85 * 2, 75, 75);
var dKoefToMM = AscCommon.g_dKoef_pix_to_mm; var dKoefToMM = AscCommon.g_dKoef_pix_to_mm;
if (this.IsRetinaEnabled) if (this.IsRetinaEnabled)
...@@ -5784,7 +5770,6 @@ AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics, ...@@ -5784,7 +5770,6 @@ AscCommon.ChartPreviewManager.prototype.createChartPreview = function(_graphics,
window["native"]["DD_EndNativeDraw"](_stream); window["native"]["DD_EndNativeDraw"](_stream);
}, this, []); }, this, []);
}; };
AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
...@@ -5798,8 +5783,11 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType) ...@@ -5798,8 +5783,11 @@ AscCommon.ChartPreviewManager.prototype.getChartPreviews = function(chartType)
var _graphics = new CDrawingStream(); var _graphics = new CDrawingStream();
for (var i = 1; i < 49; ++i) if(AscCommon.g_oChartPresets[chartType]){
var nStylesCount = AscCommon.g_oChartPresets[chartType].length;
for(var i = 0; i < nStylesCount; ++i)
this.createChartPreview(_graphics, chartType, i); this.createChartPreview(_graphics, chartType, i);
}
var _stream = global_memory_stream_menu; var _stream = global_memory_stream_menu;
_stream["ClearNoAttack"](); _stream["ClearNoAttack"]();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment