Page 1 of 1

A label on the top of bar re-appeared when it's exported!

Posted: Wed Aug 03, 2005 7:34 am
by 9523580
Hello,
I have a bar graph. What I tried to accomplish is to show the labels only for the max and min value and hide the labels in-between. Please have a look at the following diagrams.

Image
figure1. when a chart is created from the data.

Image
figure2. when the chart is exported to a meta-file.

I also attach the sample of my code.

Code: Select all

void CTChart::OnGetSeriesMark(long SeriesIndex, long ValueIndex, BSTR FAR* MarkText)
{
   if ( showmode == 1 ) {      
      double maxVal = Series(SeriesIndex).GetYValues().GetMaximum();
      double minVal = Series(SeriesIndex).GetYValues().GetMinimum();
      
      char maxBuf[50];
      char minBuf[50];
 
      //sprintf(maxBuf, "%f", maxVal);
      //sprintf(minBuf, "%f", minVal);
      _gcvt( maxVal, 10, maxBuf );
      _gcvt( minVal, 10, minBuf );
 
      CString tmpStr = _T("");
      tmpStr = *MarkText;
      CComBSTR tmpBSTR = tmpStr;
      double markVal = atof(tmpStr);
      
      CComBSTR emptyStr = _T("");
      *MarkText = emptyStr.Copy();
 
      CString str = _T(""); 
      int len;
      if ( markVal == maxVal )
      {         
         len = strlen(maxBuf)-1;
         str = maxBuf[len];
         if(str == _T("."))
            maxBuf[len] = '\0';
 
         tmpBSTR = maxBuf;
         *MarkText = tmpBSTR.Copy();
      }
      if ( markVal == minVal )
      {
         len = strlen(minBuf)-1;
         str = minBuf[len];
         if(str == _T("."))
            minBuf[len] = '\0';
 
         tmpBSTR = minBuf;
         *MarkText = tmpBSTR.Copy();
      }
   }
   else if ( showmode == 2 ) {
      CString sName = _T("");
      sName = Series(SeriesIndex).GetTitle();
      
      CComBSTR tmpBSTR = sName;
      *MarkText = tmpBSTR.Copy();
   }
}
I wish the matter to be solved as soon as possible since there are customers waiting for this to be sorted out.

Tee-chart Version 6 (6006)

Many thanks.

Posted: Wed Aug 03, 2005 3:19 pm
by Pep
Hi,

I've tried to reproduce the problem here, but it works fine using the v6.0.0.6. I've posted a simple example in the news://www.steema.net/steema.public.attachments newsgroup which hides the first Mark and the allows you to export it to Metafile and the Mark still as hide in the generated file.
Could you please test if it works fine for you ?