peehaichpee Posted March 13, 2012 Share Posted March 13, 2012 I built a chart using PHPRunner and that's all cool but I dont' want the whole thing, I just really want the legend, is there a way to work out how that is being formed so I can just pinch that code? here's the settings.php $tdatamaster_Chart["Asset Description"]=$fdata; $tdatamaster_Chart[".chartXml"] = '<chart> <attr value="tables"> <attr value="0">master Chart</attr> </attr> <attr value="chart_type"> <attr value="type">2d_column</attr> </attr> <attr value="parameters">'; $tdatamaster_Chart[".chartXml"] .= '<attr value="0"> <attr value="name">Asset Count</attr> <attr value="currencyFormat">0</attr> <attr value="decimalFormat">0</attr> <attr value="customFormat">0</attr> <attr value="customFormatStr"></attr>'; $tdatamaster_Chart[".chartXml"] .= '</attr>'; $tdatamaster_Chart[".chartXml"] .= '<attr value="1"> <attr value="name">Asset Description</attr> </attr>'; $tdatamaster_Chart[".chartXml"] .= '</attr> <attr value="appearance">'; $tdatamaster_Chart[".chartXml"] .= '<attr value="scolor11">FF0000</attr> <attr value="scolor12">FF0000</attr>'; $tdatamaster_Chart[".chartXml"] .= '<attr value="head">'.xmlencode("Asset Description Count").'</attr> <attr value="foot">'.xmlencode("Assets").'</attr> <attr value="y_axis_label">'.xmlencode("CoCd").'</attr> <attr value="color51">49563A</attr> <attr value="color52">49563A</attr> <attr value="color61">49563A</attr> <attr value="color62">49563A</attr> <attr value="color71">FDFAF6</attr> <attr value="color72">FDFAF6</attr> <attr value="color81">F5E5CB</attr> <attr value="color82">F5E5CB</attr> <attr value="color91">000000</attr> <attr value="color92">000000</attr> <attr value="color101">000000</attr> <attr value="color102">000000</attr> <attr value="color111">000000</attr> <attr value="color112">000000</attr> <attr value="color121"></attr> <attr value="color122"></attr> <attr value="color131">000000</attr> <attr value="color132">000000</attr> <attr value="color141">000000</attr> <attr value="color142">000000</attr> <attr value="slegend">true</attr> <attr value="sgrid">false</attr> <attr value="sname">true</attr> <attr value="sval">true</attr> <attr value="sanim">true</attr> <attr value="sstacked">false</attr> <attr value="saxes">false</attr> <attr value="slog">false</attr> <attr value="aqua">0</attr> <attr value="cview">0</attr> <attr value="is3d">0</attr> <attr value="isstacked">0</attr> <attr value="linestyle">0</attr> <attr value="autoupdate">0</attr> <attr value="autoupmin">5</attr> <attr value="cscroll">true</attr> <attr value="maxbarscroll">10</attr>'; $tdatamaster_Chart[".chartXml"] .= '</attr> <attr value="fields">'; $tdatamaster_Chart[".chartXml"] .= '<attr value="0"> <attr value="name">Asset Count</attr> <attr value="label">'.xmlencode("Asset Count").'</attr> <attr value="search"></attr> </attr>'; $tdatamaster_Chart[".chartXml"] .= '<attr value="1"> <attr value="name">Asset Description</attr> <attr value="label">'.xmlencode("Asset Description").'</attr> <attr value="search"></attr> </attr>'; $tdatamaster_Chart[".chartXml"] .= '</attr> <attr value="settings"> <attr value="name">master Chart</attr> <attr value="short_table_name">master_Chart</attr> </attr> </chart>'; $tables_data["master Chart"]=&$tdatamaster_Chart; $field_labels["master_Chart"] = &$fieldLabelsmaster_Chart; $fieldToolTips["master Chart"] = &$fieldToolTipsmaster_Chart; // -----------------start prepare master-details data arrays ------------------------------// // tables which are detail tables for current table (master) $detailsTablesData["master Chart"] = array(); // tables which are master tables for current table (detail) $masterTablesData["master Chart"] = array(); // -----------------end prepare master-details data arrays ------------------------------// require_once(getabspath("classes/sql.php")); function createSqlQuery_master_Chart() { $proto0=array(); $proto0["m_strHead"] = "SELECT DIstinct"; $proto0["m_strFieldList"] = "COUNT(`Asset Description`) AS `Asset Count`, `Asset Description`"; $proto0["m_strFrom"] = "FROM master"; $proto0["m_strWhere"] = ""; $proto0["m_strOrderBy"] = ""; $proto0["m_strTail"] = "GROUP BY `Asset Description`"; $proto1=array(); $proto1["m_sql"] = ""; $proto1["m_uniontype"] = "SQLL_UNKNOWN"; $obj = new SQLNonParsed(array( "m_sql" => "" )); $proto1["m_column"]=$obj; $proto1["m_contained"] = array(); $proto1["m_strCase"] = ""; $proto1["m_havingmode"] = "0"; $proto1["m_inBrackets"] = "0"; $proto1["m_useAlias"] = "0"; $obj = new SQLLogicalExpr($proto1); $proto0["m_where"] = $obj; $proto3=array(); $proto3["m_sql"] = ""; $proto3["m_uniontype"] = "SQLL_UNKNOWN"; $obj = new SQLNonParsed(array( "m_sql" => "" )); $proto3["m_column"]=$obj; $proto3["m_contained"] = array(); $proto3["m_strCase"] = ""; $proto3["m_havingmode"] = "0"; $proto3["m_inBrackets"] = "0"; $proto3["m_useAlias"] = "0"; $obj = new SQLLogicalExpr($proto3); $proto0["m_having"] = $obj; $proto0["m_fieldlist"] = array(); $proto5=array(); $proto6=array(); $proto6["m_functiontype"] = "SQLF_COUNT"; $proto6["m_arguments"] = array(); $obj = new SQLField(array( "m_strName" => "Asset Description", "m_strTable" => "master" )); $proto6["m_arguments"][]=$obj; $proto6["m_strFunctionName"] = "COUNT"; $obj = new SQLFunctionCall($proto6); $proto5["m_expr"]=$obj; $proto5["m_alias"] = "Asset Count"; $obj = new SQLFieldListItem($proto5); $proto0["m_fieldlist"][]=$obj; $proto8=array(); $obj = new SQLField(array( "m_strName" => "Asset Description", "m_strTable" => "master" )); $proto8["m_expr"]=$obj; $proto8["m_alias"] = ""; $obj = new SQLFieldListItem($proto8); $proto0["m_fieldlist"][]=$obj; $proto0["m_fromlist"] = array(); $proto10=array(); $proto10["m_link"] = "SQLL_MAIN"; $proto11=array(); $proto11["m_strName"] = "master"; $proto11["m_columns"] = array(); $proto11["m_columns"][] = "Asset Number"; $proto11["m_columns"][] = "Asset Description"; $proto11["m_columns"][] = "CoCd"; $proto11["m_columns"][] = "Class"; $proto11["m_columns"][] = "Serial No#"; $proto11["m_columns"][] = "Invent No"; $proto11["m_columns"][] = "CostCentre"; $proto11["m_columns"][] = "Plnt"; $proto11["m_columns"][] = "LOCATION"; $proto11["m_columns"][] = "Location Name"; $proto11["m_columns"][] = "Remarks"; $proto11["m_columns"][] = "Formula"; $proto11["m_columns"][] = "sub class"; $proto11["m_columns"][] = "Cost"; $proto11["m_columns"][] = "W Start"; $proto11["m_columns"][] = "AssetDeleted"; $obj = new SQLTable($proto11); $proto10["m_table"] = $obj; $proto10["m_alias"] = ""; $proto12=array(); $proto12["m_sql"] = ""; $proto12["m_uniontype"] = "SQLL_UNKNOWN"; $obj = new SQLNonParsed(array( "m_sql" => "" )); $proto12["m_column"]=$obj; $proto12["m_contained"] = array(); $proto12["m_strCase"] = ""; $proto12["m_havingmode"] = "0"; $proto12["m_inBrackets"] = "0"; $proto12["m_useAlias"] = "0"; $obj = new SQLLogicalExpr($proto12); $proto10["m_joinon"] = $obj; $obj = new SQLFromListItem($proto10); $proto0["m_fromlist"][]=$obj; $proto0["m_groupby"] = array(); $proto14=array(); $obj = new SQLField(array( "m_strName" => "Asset Description", "m_strTable" => "master" )); $proto14["m_column"]=$obj; $obj = new SQLGroupByItem($proto14); $proto0["m_groupby"][]=$obj; $proto0["m_orderby"] = array(); $obj = new SQLQuery($proto0); return $obj; } $queryData_master_Chart = createSqlQuery_master_Chart(); $tdatamaster_Chart[".sqlquery"] = $queryData_master_Chart; $tableEvents["master Chart"] = new eventsBase; $tdatamaster_Chart[".hasEvents"] = false; Quote Link to comment https://forums.phpfreaks.com/topic/258803-bit-of-a-big-one-pulling-a-chart-apart/ Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.