示例#1
0
    private string get_dashboard_cell(int iPixelWidth, int iPixelHeight, string sContent)
    {
        // id=dashboard_cell_x (starting from 0)

        DASHBOARD_CELL newCell = cellList[iCellIdCounter] = new DASHBOARD_CELL();

        if (iCellIdCounter == 1)
        {
            newCell.chartType = CHART_TYPE.line_3_lines;
        }
        else if (iCellIdCounter == 2)
        {
            newCell.chartType = CHART_TYPE.bember_heading_and_percent;
        }
        else if (iCellIdCounter == 3)
        {
            newCell.chartType = CHART_TYPE.line_4_lines;
        }
        else if (iCellIdCounter == 4)
        {
            newCell.chartType = CHART_TYPE.pie_donut;
        }
        else
        {
            newCell.chartType = CHART_TYPE.bember_heading_and_percent;
        }

        StringBuilder sb = new StringBuilder();

        string sId = sPreDashBoardCellName + iCellIdCounter.ToString();

        // Before 19 oct newCell.w = getPixelWidthAvailable(iPixelWidth);
        // Before 19 oct newCell.h = getPixelWidthAvailable(iPixelHeight);

        newCell.w = getPixelWidthAvailable(iPixelWidth);
        newCell.h = getPixelWidthAvailable(iPixelHeight);

        sb.Append(
            "<div onclick=dashboard_cell_clicked('" + sPreDashBoardCellName +
            "','" + iCellIdCounter.ToString() + "') id=" + sId +
            " class=dashboard_cell style='float:left;width:" + newCell.w.ToString() + "px;height:" + newCell.h.ToString() + "px;' " +
            "data-orgwidth='" + newCell.w.ToString() + "px' data-orgheight='" + newCell.h.ToString() + "px' >");
        sb.Append(sContent);
        sb.Append("</div>");

        ++iCellIdCounter;

        return(sb.ToString());
    }
    private string get_dashboard_cell(int iPixelWidth, int iPixelHeight, string sContent)
    {
        // id=dashboard_cell_x (starting from 0)

        DASHBOARD_CELL newCell = cellList[iCellIdCounter] = new DASHBOARD_CELL();

        if (iCellIdCounter == 1) newCell.chartType = CHART_TYPE.line_3_lines;
        else if (iCellIdCounter == 2) newCell.chartType = CHART_TYPE.bember_heading_and_percent;
        else if (iCellIdCounter == 3) newCell.chartType = CHART_TYPE.line_4_lines;
        else if (iCellIdCounter == 4) newCell.chartType = CHART_TYPE.pie_donut;
        else newCell.chartType = CHART_TYPE.bember_heading_and_percent;

        StringBuilder sb = new StringBuilder();

        string sId = sPreDashBoardCellName + iCellIdCounter.ToString();

        // Before 19 oct newCell.w = getPixelWidthAvailable(iPixelWidth);
        // Before 19 oct newCell.h = getPixelWidthAvailable(iPixelHeight);

        newCell.w = getPixelWidthAvailable(iPixelWidth);
        newCell.h = getPixelWidthAvailable(iPixelHeight);

        sb.Append(
            "<div onclick=dashboard_cell_clicked('" + sPreDashBoardCellName +
            "','" + iCellIdCounter.ToString() + "') id=" + sId +
            " class=dashboard_cell style='float:left;width:" + newCell.w.ToString() + "px;height:" + newCell.h.ToString() + "px;' " +
            "data-orgwidth='" + newCell.w.ToString() + "px' data-orgheight='" + newCell.h.ToString() + "px' >");
        sb.Append(sContent);
        sb.Append("</div>");

        ++iCellIdCounter;

        return sb.ToString();
    }