private void series_SelectedIndexChanged(object sender, EventArgs e)
        {
            ViewType viewType;

            switch ((string)series.SelectedItem)
            {
            case "Pie 3D":
                viewType = ViewType.Pie3D;
                break;

            case "Doughnut":
                viewType = ViewType.Doughnut;
                break;

            case "Doughnut 3D":
                viewType = ViewType.Doughnut3D;
                break;

            case "Bar":
                viewType = ViewType.Bar;
                break;

            case "Line":
                viewType = ViewType.Line;
                break;

            case "FullStackedBar":
                viewType = ViewType.FullStackedBar;
                break;

            default:
                viewType = ViewType.FullStackedBar;
                break;
            }

            chartControl1.SeriesTemplate.ChangeView(viewType);

            DoughnutSeriesView view = chartControl1.Series[0].View as DoughnutSeriesView;

            if (view != null)
            {
                view.HoleRadiusPercent = Convert.ToInt32("55");
            }

            Diagram3D diagram = chartControl1.Diagram as Diagram3D;

            if (diagram != null)
            {
                diagram.RuntimeRotation  = true;
                diagram.RuntimeScrolling = true;
                diagram.RuntimeZooming   = true;
            }
            GrafikYenile();
        }
Example #2
0
        void watchListGridView_FocusedRowChanged(object sender, FocusedRowChangedEventArgs e)
        {
            StockMarketView.defaultViewModel.SelectedCompany = watchListGridView.GetFocusedRow() as CompanyTradingDataViewModel;
            selectedCompanyName = StockMarketView.defaultViewModel.SelectedCompany.CompanyName;
            SeriesPoint        sPoint = FindSeriesPointByName(StockMarketView.defaultViewModel.SelectedCompany.CompanyName);
            DoughnutSeriesView view   = volumeChart.Series[0].View as DoughnutSeriesView;

            if (sPoint != null && view != null)
            {
                ExplodePoint(sPoint, view);
            }
            else
            {
                view.ExplodedPoints.Clear();
            }
        }
Example #3
0
 void OnVolumeChartBoundDataChanged(object sender, EventArgs e)
 {
     if (volumeChart.Series[0].Points.Count > 0 && selectedPiePointIndex != -1 && volumeChart.Series[0].Points.Count > selectedPiePointIndex)
     {
         DoughnutSeriesView view = volumeChart.Series[0].View as DoughnutSeriesView;
         for (int i = 0; i < volumeChart.Series[0].Points.Count; i++)
         {
             if (selectedCompanyName == volumeChart.Series[0].Points[i].Argument.ToString())
             {
                 ExplodePoint(volumeChart.Series[0].Points[i], view);
                 selectedPiePointIndex = i;
                 break;
             }
         }
     }
 }
Example #4
0
        //void transactionGridView_CustomDrawCell(object sender, RowCellCustomDrawEventArgs e) {
        //    if(StockMarketView.defaultViewModel == null)
        //        return;
        //    double cellValue = -1;
        //    GridCellInfo info = e.Cell as GridCellInfo;
        //    if(info == null)
        //        return;
        //    double.TryParse(e.CellValue.ToString(), out cellValue);
        //    if(cellValue != -1) {
        //        if(cellValue == 0) {
        //            info.Appearance.ForeColor = e.Appearance.BackColor;
        //            return;
        //        }
        //        TransactionData rowData = transactionGridView.GetRow(e.RowHandle) as TransactionData;
        //        if(rowData.TransactionType == "Ask")
        //            info.Appearance.ForeColor = green;
        //        else info.Appearance.ForeColor = red;
        //    }
        //}
        void volumeChart_MouseDown(object sender, MouseEventArgs e)
        {
            SeriesPoint        seriesPoint = volumeChart.CalcHitInfo(e.Location).SeriesPoint;
            DoughnutSeriesView view        = volumeChart.Series[0].View as DoughnutSeriesView;

            if (seriesPoint == null || view == null)
            {
                return;
            }
            ExplodePoint(seriesPoint, view);
            int rowH = GetRowHandleByCompanyName(selectedCompanyName);

            if (rowH >= 0)
            {
                watchListGridView.FocusedRowHandle = rowH;
            }
        }
Example #5
0
 void ExplodePoint(SeriesPoint seriesPoint, DoughnutSeriesView view)
 {
     view.ExplodedPoints.Clear();
     view.ExplodedPoints.Add(seriesPoint);
     selectedCompanyName = seriesPoint.Argument.ToString();
 }