Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. MFC SeriesCollection question

MFC SeriesCollection question

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    Mardigin
    wrote on last edited by
    #1

    How do I write ActiveChart.SeriesCollection(1).XValues = "={""Date 08102003"","" Date 08102003""}" in MFC? Here is my code for the chartwiz.. this->m_xlChart->ChartWizard(var, // Source. COleVariant((short)3), // Gallery: 2d Column. COleVariant((short)2), // Format. COleVariant((short)2), // PlotBy xlColumns. COleVariant((short)0), // CategoryLabels. COleVariant((short)1), // SeriesLabels. COleVariant((short)TRUE), // HasLegend. COleVariant("MyChart"), // Title. COleVariant("Date"), // CategoryTitle. COleVariant("UNITS"), // ValueTitles. covOptional ); Basically I want to change Category (X) axis labels to something other then 1, 2, 3... etc. Sincerely, Mardigin

    M 1 Reply Last reply
    0
    • M Mardigin

      How do I write ActiveChart.SeriesCollection(1).XValues = "={""Date 08102003"","" Date 08102003""}" in MFC? Here is my code for the chartwiz.. this->m_xlChart->ChartWizard(var, // Source. COleVariant((short)3), // Gallery: 2d Column. COleVariant((short)2), // Format. COleVariant((short)2), // PlotBy xlColumns. COleVariant((short)0), // CategoryLabels. COleVariant((short)1), // SeriesLabels. COleVariant((short)TRUE), // HasLegend. COleVariant("MyChart"), // Title. COleVariant("Date"), // CategoryTitle. COleVariant("UNITS"), // ValueTitles. covOptional ); Basically I want to change Category (X) axis labels to something other then 1, 2, 3... etc. Sincerely, Mardigin

      M Offline
      M Offline
      Mardigin
      wrote on last edited by
      #2

      Disregard, I just solved this problem. Silly me. Here is the solution if anyone is interested. xlSeries = this->m_xlChart->SeriesCollection(COleVariant((short)1)); VARIANT vResult; // A Struct with a pdispVal member VARTYPE vType; DISPID dispID; // Temporary DISPID unsigned short *ucPtr; // Temporary name holder ucPtr = L"XValues"; HRESULT hr = xlSeries.m_lpDispatch->GetIDsOfNames( IID_NULL, &ucPtr, 1, ACCESS_PROPERTY_GUID, &dispID ); //CString result; CString lpszNewValue= "={""Label1"",""Label2""}"; if(hr == S_OK) { xlSeries.SetXValues(COleVariant(lpszNewValue)); } Sincerely, Mardigin

      R 1 Reply Last reply
      0
      • M Mardigin

        Disregard, I just solved this problem. Silly me. Here is the solution if anyone is interested. xlSeries = this->m_xlChart->SeriesCollection(COleVariant((short)1)); VARIANT vResult; // A Struct with a pdispVal member VARTYPE vType; DISPID dispID; // Temporary DISPID unsigned short *ucPtr; // Temporary name holder ucPtr = L"XValues"; HRESULT hr = xlSeries.m_lpDispatch->GetIDsOfNames( IID_NULL, &ucPtr, 1, ACCESS_PROPERTY_GUID, &dispID ); //CString result; CString lpszNewValue= "={""Label1"",""Label2""}"; if(hr == S_OK) { xlSeries.SetXValues(COleVariant(lpszNewValue)); } Sincerely, Mardigin

        R Offline
        R Offline
        Ryan Binns
        wrote on last edited by
        #3

        Mardigin wrote: CString lpszNewValue= "={""Label1"",""Label2""}"; In C++, to insert a """ character you have to use "\"", not """" like in VB.

        Ryan

        "Punctuality is only a virtue for those who aren't smart enough to think of good excuses for being late" John Nichol "Point Of Impact"

        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups