コード例 #1
0
        private void loadChartData()
        {
            String[] data = SaleItem.getItemAnalysisData("DESC");

            String[] names      = new String[5];
            int[]    quantities = new int[5];

            for (int i = 0; i < 5; i++)
            {
                String[] splitItems = data[i].Split(',');

                names[i]      = SaleItem.getNameFromID(Convert.ToInt32(splitItems[0]));
                quantities[i] = Convert.ToInt32(splitItems[1]);
            }

            chtTop5.Series[0].Points.Clear();
            chtTop5.Series[0].Points.DataBindXY(names, quantities);

            data = SaleItem.getItemAnalysisData("ASC");

            for (int i = 0; i < 5; i++)
            {
                String[] splitItems = data[i].Split(',');

                names[i]      = SaleItem.getNameFromID(Convert.ToInt32(splitItems[0]));
                quantities[i] = Convert.ToInt32(splitItems[1]);
            }

            chtBottom5.Series[0].Points.Clear();
            chtBottom5.Series[0].Points.DataBindXY(names, quantities);
        }