Page Index Toggle Pages: 1 Send TopicPrint
Normal Topic Issues with displaying text in SVG ClientSideMode (Read 2538 times)
LGK
YaBB Newbies
*
Offline



Posts: 30
Location: Boston, MA
Joined: Mar 29th, 2012
Issues with displaying text in SVG ClientSideMode
Jul 4th, 2012 at 1:44pm
Print Post  
We have noticed that we're having certain text display issues when rendering our graphs in SVG ClientSideMode. The particular issue is that some of the text gets trimmed and does not get displayed (while it's displayed perfectly in ImageMap mode with the same exact node settings).

Please see the attached screenshots - one taken in SVG mode and one in ImageMap. You will notice that ImageMap fully displays the text and SVG trims some of the labels (I believe I've seen the same behavior with the SVG exporter).

Here's the C# code that sets up my TableNode's:

Code (C++)
Select All
            TableNode node = PFVGraph.Diagram.Factory.CreateTableNode(0, 0, 0, 0, 2, 7);

            node.ZIndex = 1;
            if (PFVGraph.ClientSideMode == ClientSideMode.ImageMap)
            {
                node.HyperLink = "javascript:void(0)";
            }
            node.Id = recordId;
            node.Caption = String.Empty;
            node.CaptionHeight = 0f;
            node.CellFrameStyle = CellFrameStyle.None;
            node.ConnectionStyle = TableConnectionStyle.Table;
            if (recordId == currentRecordId.Value)
            {
                node.Brush = new SolidBrush(System.Drawing.Color.FromArgb(240, 245, 252));
            }
            else
            {
                node.Brush = new SolidBrush(System.Drawing.Color.White);
            }

            node[0, 0].Text = recordId.ToString();
            node.Columns[0].Width = 20f;
            node[0, 0].HyperLink = String.Format("javascript:GoToPatent('{0}')", recordId);
            node[0, 0].TextColor = System.Drawing.Color.DarkBlue;
            node[0, 0].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Underline | System.Drawing.FontStyle.Bold);
            node[0, 0].Brush = new SolidBrush(System.Drawing.Color.FromArgb(195, 208, 228));

            System.Drawing.StringFormat rightAlign = new System.Drawing.StringFormat();
            rightAlign.Alignment = System.Drawing.StringAlignment.Far;
            rightAlign.LineAlignment = System.Drawing.StringAlignment.Near;

            node[1, 0].Text = "View";
            node[1, 0].HyperLink = String.Format("javascript:SetSubjectRecord('{0}')", recordId);
            node[1, 0].TextColor = System.Drawing.Color.DarkBlue;
            node[1, 0].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Underline | System.Drawing.FontStyle.Bold);
            node[1, 0].TextFormat = rightAlign;
            node[1, 0].Brush = new SolidBrush(System.Drawing.Color.FromArgb(195, 208, 228));
            node.Rows[0].Height = 6;

            node[0, 1].Text = "Ref. #:";
            node[0, 1].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Bold);
            node[0, 1].TextFormat = rightAlign;
            node[1, 1].Text = displayRecord.ReferenceNumber;
            node[1, 1].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Regular);
            node.Rows[1].Height = 2;

            node[0, 2].Text = "App. #:";
            node[0, 2].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Bold);
            node[0, 2].TextFormat = rightAlign;
            node[1, 2].Text = displayRecord.ApplicationNumber;
            node[1, 2].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Regular);
            node.Rows[2].Height = 2;

            node[0, 3].Text = "Filed Date:";
            node[0, 3].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Bold);
            node[0, 3].TextFormat = rightAlign;
            node[1, 3].Text = displayRecord.FiledDate.HasValue ? displayPatent.FiledDate.Value.ToString(m_DateFormatString) : String.Empty;
            node[1, 3].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Regular);
            node.Rows[3].Height = 2;

            node[0, 4].Text = "Granted Date:";
            node[0, 4].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Bold);
            node[0, 4].TextFormat = rightAlign;
            node[1, 4].Text = displayRecord.GrantedDate.HasValue ? displayPatent.GrantedDate.Value.ToString(m_DateFormatString) : String.Empty;
            node[1, 4].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Regular);
            node.Rows[4].Height = 2;

            node[0, 5].Text = "Status:";
            node[0, 5].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Bold);
            node[0, 5].TextFormat = rightAlign;
            node[1, 5].Text = displayRecord.PatentStatus.StatusName;
            node[1, 5].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Regular);
            node.Rows[5].Height = 2;

            node[0, 6].ColumnSpan = 2;
            node[0, 6].Text = "more...";
            node[0, 6].HyperLink = "javascript:ShowMoreInfo();";
            node[0, 6].TextColor = System.Drawing.Color.DarkBlue;
            node[0, 6].Font = new System.Drawing.Font("Arial", 7f, System.Drawing.FontStyle.Underline);
            System.Drawing.StringFormat centerAlign = new System.Drawing.StringFormat();
            centerAlign.Alignment = System.Drawing.StringAlignment.Center;
            centerAlign.LineAlignment = System.Drawing.StringAlignment.Center;
            node[0, 6].TextFormat = centerAlign;
            node.Rows[6].Height = 2;

            node.ResizeToFitText(true, false);
 



Is this anything can be easily addressed?

Many thanks!
  

SVG_Label_Issues.png (Attachment deleted)
ImageMap_No_Label_Issues.png (Attachment deleted)
Back to top
 
IP Logged
 
Stoyo
God Member
*****
Offline


MindFusion support

Posts: 13230
Joined: Jul 20th, 2005
Re: Issues with displaying text in SVG ClientSideMode
Reply #1 - Jul 6th, 2012 at 7:35am
Print Post  
We can only approximate the GDI+ text formatting in SVG, so text output will never be exactly the same. In this case the control's text layout function probably decides there's no enough space for the last word and wraps it to a new line.

You could add a couple of millimeters to the column widths to provide more space for text. Alternatively, try setting table.EnableStyledText to true. With that enabled, the control will not use GDI+ formatting but our own algorithm both when drawing in ImageMap and SVG modes, so you should get closer results.

I hope that helps,
Stoyan
  
Back to top
 
IP Logged
 
LGK
YaBB Newbies
*
Offline



Posts: 30
Location: Boston, MA
Joined: Mar 29th, 2012
Re: Issues with displaying text in SVG ClientSideMode
Reply #2 - Jul 6th, 2012 at 12:28pm
Print Post  
Setting TableNode.EnableStyledText="true" seems to have solved the problem - thank you! Now all the text is visible and readable.

  
Back to top
 
IP Logged
 
Page Index Toggle Pages: 1
Send TopicPrint