Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

C# MSChart.Net 3.5 Control

Empfohlene Antworten

Veröffentlicht

Hallo,

die forum suche ergab leider nicht all zu viele treffer (search tag = mschart), trozdem hoffe ich das mir jemand helfen kann! *LIEB KUCK*

Also mein Problem:

Ich verwende C# Framework 3.5. In diesem Windows Application Projekt habe ich ein Form in dem ich das MSChart.Net 3.5 Control verwende.

Hierzu gibt es auch ein super sample wpf projekt:

Samples Environment for Microsoft Chart Controls - Home

Soweit funktioniert auch alles bei mir, bloss macht er mir bei größeren Werten (Also Wenn ein Stack des Stacked Charts viel größer wie die anderen ist), so komische Schwarze Hacken rein (siehe anhang).

Ich weiß nicht wie ich die dinger weg bekomme.

Mit folgenden Code befülle ich das Chart:

        private void InitGraph()

        {

            m_Statistic.Sort(new StatisticComparer(ListSortDirection.Descending));

            foreach (StatisticSeries statistic in m_Statistic)

            {                

                foreach(StatisticItem item in statistic.StatisticItems)

                {

                    if (StackedChart.Series.FindByName(item.Label) == null)

                    {

                        Series newSeries = StackedChart.Series.Add(item.Label);

                        newSeries.ChartArea = "Base";

                        newSeries.ChartType = SeriesChartType.StackedColumn;

                        newSeries.IsValueShownAsLabel = true;

                        newSeries.LabelForeColor = Color.White;                        


                        newSeries.EmptyPointStyle.IsValueShownAsLabel = false;

                        newSeries.EmptyPointStyle.MarkerStyle = MarkerStyle.None;

                    }




                    double YValue = (item.Quantity) <= 0.0 ? double.NaN : item.Quantity;

                    int iPointIndex = StackedChart.Series[item.Label].Points.AddXY(statistic.SeriesNameWithCount, YValue);                    

                    StackedChart.Series[item.Label].Points[iPointIndex].Tag = item;                    

                }

            }            

        }

ich hoffe ihr könnt mir helfen, oder gibt es ein forum für das Control ?

Kennt da jemand was?

Besten Danke

Nokinger

post-20938-14430448665863_thumb.png

Hallo,

ich habe zwar keine Ahnung von dem Control, allerdings sieht es mir ganz stark danach aus, dass hier einfach nur die Werte für die einzelnen Blöcke angegeben werden, welche einfach zu klein sind, um den Wert dort einzutragen.

Du kannst ja einfach mal ein paar größere Werte dort eintrage, um das zu verifizieren.

Gruß

Marboro

Hallo,

genau das ist das Problem.

Ich setzt ja die Property: newSeries.IsValueShownAsLabel = true;

wenn ich die Point Values ausblende sind die dinger weg.

Wenn ich die Point Values auf eine Mindestgröße festlege kann er auch den Text richtig rein packen .... und die hässlichen Schwarzen dinge sind weg.

Nur wie bekomme ich das jetzt hin das er den Point Value schön anzeigt. Das muss doch möglich sein !?

Grüße

Nokinger

  • 1 Monat später...

ich habe mir heute nochmals das Thema angenommen, und bin über die smart labels gestoßen!

"When smart labels are enabled, the Chart control first attempts to reposition an overlapping data point label near the data point itself. If it fails, the Chart control then moves the data point label to a valid free space and draws a callout line to link the label with the data point."

so hab ich das für jede Serie nun Eingestellt und nun sieht das ganze nicht mehr ganz so "blöd" aus.

newSeries.SmartLabelStyle.Enabled = true;

newSeries.SmartLabelStyle.AllowOutsidePlotArea = LabelOutsidePlotAreaStyle.No;

newSeries.SmartLabelStyle.CalloutLineAnchorCapStyle = LineAnchorCapStyle.None;

newSeries.SmartLabelStyle.CalloutLineColor = Color.Transparent;

newSeries.SmartLabelStyle.CalloutLineWidth = 0;

newSeries.SmartLabelStyle.CalloutStyle = LabelCalloutStyle.None;

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.