Commit 8542d103 authored by Elen.Subbotina's avatar Elen.Subbotina Committed by Alexander Trofimov

миноритарные свойства диаграмм разных типов

git-svn-id: svn://fileserver/activex/AVS/Sources/TeamlabOffice/trunk/ServerComponents@56339 954022d7-b5bf-4e40-9824-e11837661b57
parent 2d619c36
......@@ -34,7 +34,14 @@ public:
void set_chart_3D(bool Val);
void set_chart_size(double width_pt, double height_pt);
void set_chart_colored(bool val);
void set_chart_grouping(int type);
void set_chart_scatter_type(int type);
void set_chart_bar_grouping(int type);
void set_chart_bar_direction(int type);
void set_chart_bar_type(int type);
void set_chart_bar_gap_width(std::wstring val);
void set_chart_bar_overlap(std::wstring val);
void set_chart_radar_type(int type);
void set_marker_size(int size);
void set_marker_type(int type);
......@@ -79,6 +86,9 @@ public:
void start_floor();
void start_wall();
void set_legend_position(int val);
void start_stock_gain_marker();
void start_stock_loss_marker();
void start_stock_range_line();
void start_element(office_element_ptr & elm, office_element_ptr & style_elm, std::wstring style_name);
void end_element();
......
......@@ -493,7 +493,7 @@ void odf_drawing_context::set_no_fill()
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill::none;
break;
case Line:
impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill::none;
//impl_->current_graphic_properties->content().common_draw_fill_attlist_.draw_fill_ = draw_fill::none;??????
impl_->current_graphic_properties->content().draw_stroke_ = line_style (line_style::None);
break;
}
......
......@@ -44,6 +44,7 @@ void chart_format_properties::serialize(std::wostream & _Wostream ,const wchar_t
CP_XML_ATTR_OPT(L"chart:mean-value", chart_mean_value_ );
CP_XML_ATTR_OPT(L"chart:error-upper-indicator", chart_error_upper_indicator_ );
CP_XML_ATTR_OPT(L"chart:error-lower-indicator", chart_error_lower_indicator_ );
CP_XML_ATTR_OPT(L"chart:treat-empty-cells", chart_treat_empty_cells_);
CP_XML_ATTR_OPT(L"chart:symbol-type", chart_symbol_type_);
CP_XML_ATTR_OPT(L"chart:symbol-name", chart_symbol_name_);
......
......@@ -51,6 +51,7 @@ public:
_CP_OPT(Bool) chart_mean_value_;
_CP_OPT(Bool) chart_error_upper_indicator_;
_CP_OPT(Bool) chart_error_lower_indicator_;
_CP_OPT(Bool) chart_treat_empty_cells_;
_CP_OPT(chart_symbol_type) chart_symbol_type_;
_CP_OPT(chart_symbol_name) chart_symbol_name_;
......@@ -82,7 +83,7 @@ public:
_CP_OPT(chart_error_category) chart_error_category_;
_CP_OPT(std::wstring) chart_axis_label_position_;
_CP_OPT(std::wstring) chart_axis_position_;
_CP_OPT(std::wstring) chart_axis_position_;
common_rotation_angle_attlist common_rotation_angle_attlist_;
};
......
......@@ -304,7 +304,7 @@ public:
void convert(OOX::Spreadsheet::CT_ChartLines *grid, int type);
void convert(OOX::Spreadsheet::CT_SerTx *ser_tx);
void convert(OOX::Spreadsheet::CT_DLbls *ser_lbls);
void convert(OOX::Spreadsheet::CT_Marker *marker, int count);
void convert(OOX::Spreadsheet::CT_Marker *marker);
void convert(OOX::Spreadsheet::CT_Marker *marker, CAtlArray<OOX::Spreadsheet::CT_DPt*> & dPt);
//////////////////////////////////////////////////////////////////////////////////////////////////////////
void convert(double oox_font_size, cpdoccore::_CP_OPT(cpdoccore::odf::font_size) & odf_font_size);
......
......@@ -295,13 +295,26 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_ValAx* axis)
odf_context()->chart_context()->end_element();
}
////////////////////////////////////////////////////////////////////////////////////////////
void OoxConverter::convert(OOX::Spreadsheet::CT_ChartLines *grid, int type)
void OoxConverter::convert(OOX::Spreadsheet::CT_ChartLines *line, int type)
{
if (grid == NULL)return;
if (line == NULL)return;
odf_context()->chart_context()->start_grid(type);
convert(grid->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
if (type <3)//grid lines
{
odf_context()->chart_context()->start_grid(type);
convert(line->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
}
//if (type == 3)//drop line
//{
// odf_context()->chart_context()->s
//}
if (type == 4)//Hi-Lo line
{
odf_context()->chart_context()->start_stock_range_line();
convert(line->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
}
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Area3DChart *chart)
......@@ -311,6 +324,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Area3DChart *chart)
odf_context()->chart_context()->set_chart_type(L"area");
odf_context()->chart_context()->set_chart_3D(true);
convert (chart->m_dropLines, 3);
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_grouping(*chart->m_grouping->m_val);
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
......@@ -322,6 +340,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_AreaChart *chart)
odf_context()->chart_context()->set_chart_type(L"area");
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_grouping(*chart->m_grouping->m_val);
convert (chart->m_dropLines, 3);
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
......@@ -341,7 +364,22 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Bar3DChart *chart)
odf_context()->chart_context()->set_chart_type(L"bar");
odf_context()->chart_context()->set_chart_3D(true);
if (chart->m_shape && chart->m_shape->m_val)
odf_context()->chart_context()->set_chart_bar_type(*chart->m_shape->m_val);
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_bar_grouping(*chart->m_grouping->m_val);
if (chart->m_barDir && chart->m_barDir->m_val)
odf_context()->chart_context()->set_chart_bar_direction(*chart->m_barDir->m_val);
if (chart->m_gapWidth && chart->m_gapWidth->m_val)
odf_context()->chart_context()->set_chart_bar_gap_width(string2std_string(*chart->m_gapWidth->m_val));
//if (chart->m_overlap && chart->m_overlap->m_val)
// odf_context()->chart_context()->set_chart_bar_overlap(string2std_string(*chart->m_overlap->m_val));
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
......@@ -361,6 +399,18 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BarChart *chart)
odf_context()->chart_context()->set_chart_type(L"bar");
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_bar_grouping(*chart->m_grouping->m_val);
if (chart->m_barDir && chart->m_barDir->m_val)
odf_context()->chart_context()->set_chart_bar_direction(*chart->m_barDir->m_val);
if (chart->m_gapWidth && chart->m_gapWidth->m_val)
odf_context()->chart_context()->set_chart_bar_gap_width(string2std_string(*chart->m_gapWidth->m_val));
if (chart->m_overlap && chart->m_overlap->m_val)
odf_context()->chart_context()->set_chart_bar_overlap(string2std_string(*chart->m_overlap->m_val));
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
......@@ -379,6 +429,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Line3DChart *chart)
odf_context()->chart_context()->set_chart_type(L"line");
odf_context()->chart_context()->set_chart_3D(true);
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_grouping(*chart->m_grouping->m_val);
convert (chart->m_dropLines, 3);
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
......@@ -397,6 +452,11 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_LineChart *chart)
odf_context()->chart_context()->set_chart_type(L"line");
if (chart->m_grouping && chart->m_grouping->m_val)
odf_context()->chart_context()->set_chart_grouping(*chart->m_grouping->m_val);
convert (chart->m_dropLines, 3);
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
......@@ -542,6 +602,9 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_RadarChart *chart)
if (chart == NULL)return;
odf_context()->chart_context()->set_chart_type(L"radar");
if (chart->m_radarStyle && chart->m_radarStyle->m_val)
odf_context()->chart_context()->set_chart_radar_type(*chart->m_radarStyle->m_val);
//odf_context()->chart_context()->set_chart_grouping(2);???
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
......@@ -563,6 +626,25 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_StockChart *chart)
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
convert (chart->m_dropLines ,3);
convert (chart->m_hiLowLines, 4);
if (chart->m_upDownBars)
{
//m_gapWidth
if (chart->m_upDownBars->m_upBars)
{
odf_context()->chart_context()->start_stock_gain_marker();
convert(chart->m_upDownBars->m_upBars->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
}
if (chart->m_upDownBars->m_downBars)
{
odf_context()->chart_context()->start_stock_loss_marker();
convert(chart->m_upDownBars->m_downBars->m_oSpPr.GetPointer());
odf_context()->chart_context()->end_element();
}
}
for (long i=0; i< chart->m_ser.GetCount(); i++)
{
convert(chart->m_ser[i]);
......@@ -578,7 +660,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_OfPieChart *chart)
if (chart == NULL)return;
odf_context()->chart_context()->set_chart_type(L"circle");
odf_context()->chart_context()->start_group_series();
convert(chart->m_dLbls);
for (long i=0; i< chart->m_ser.GetCount(); i++)
......@@ -664,6 +746,10 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_BarSer* ser)
{
convert(NULL, ser->m_dPt);
}
if (ser->m_shape && ser->m_shape->m_val)
odf_context()->chart_context()->set_chart_bar_type(*ser->m_shape->m_val);
//m_trendline;
//m_errBars
odf_context()->chart_context()->end_series();
}
void OoxConverter::convert(OOX::Spreadsheet::CT_ScatterSer* ser)
......@@ -716,7 +802,7 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_LineSer* ser)
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker, CAtlArray<OOX::Spreadsheet::CT_DPt*> & dPt)
{
if (dPt.GetCount() <1) return convert(marker , -1);
if (dPt.GetCount() <1) return convert(marker);
long count_point = odf_context()->chart_context()->get_count_data_points_series();
long current_point = 0;
......@@ -727,24 +813,35 @@ void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker, CAtlArray<OOX::S
if (dPt[i]->m_idx && dPt[i]->m_idx->m_val) set_point = *dPt[i]->m_idx->m_val;
if (set_point - current_point > 0)convert(marker,set_point - current_point);
convert(dPt[i]->m_marker,1);
if (set_point - current_point > 0)
{
odf_context()->chart_context()->start_data_point_series(set_point - current_point);
convert(marker);
odf_context()->chart_context()->end_element();
}
odf_context()->chart_context()->start_data_point_series(1);
convert(dPt[i]->m_oSpPr.GetPointer());
convert(dPt[i]->m_marker);
odf_context()->chart_context()->end_element();
current_point = set_point+1;
}
if (count_point - current_point >0) convert(marker,count_point - current_point);
if (count_point - current_point >0)
{
odf_context()->chart_context()->start_data_point_series(count_point - current_point);
convert(marker);
odf_context()->chart_context()->end_element();
}
}
void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker, int count)
void OoxConverter::convert(OOX::Spreadsheet::CT_Marker* marker)
{
if (count >0)odf_context()->chart_context()->start_data_point_series(count);
if (marker)
{
if (marker->m_symbol && marker->m_symbol->m_val)
odf_context()->chart_context()->set_marker_type(*marker->m_symbol->m_val);
if (marker->m_size && marker->m_size->m_val)
odf_context()->chart_context()->set_marker_size(*marker->m_size->m_val);
convert(marker->m_oSpPr.GetPointer());
}
if (count >0)odf_context()->chart_context()->end_element();
if (marker == NULL) return;
if (marker->m_symbol && marker->m_symbol->m_val)
odf_context()->chart_context()->set_marker_type(*marker->m_symbol->m_val);
if (marker->m_size && marker->m_size->m_val)
odf_context()->chart_context()->set_marker_size(*marker->m_size->m_val);
convert(marker->m_oSpPr.GetPointer());
}
void OoxConverter::convert(OOX::Spreadsheet::CT_DLbls* ser_lbls)
{
......
......@@ -2,6 +2,6 @@
//1
//2
//0
//45
#define INTVER 1,2,0,45
#define STRVER "1,2,0,45\0"
//46
#define INTVER 1,2,0,46
#define STRVER "1,2,0,46\0"
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