Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8081593
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T16:46:52+00:00 2026-06-05T16:46:52+00:00

I am getting the error Assignment to readonly property when trying to assign a

  • 0

I am getting the error “Assignment to readonly property” when trying to assign a value to the lineColor and lineWidth of a lineStyle. What I am trying to do is set the borderLineStyle property of a pie chart to be a lineStyle with my preferences.

I have made a property and synthesized it, but am still unable to set these values.

Below is the snippet of code that is located in the same place the other pieChart properties are being set.

self.myLineStyle = [CPTLineStyle lineStyle];
self.myLineStyle.lineColor = [CPTColor whiteColor];  //Assignment to readonly property
self.myLineStyle.lineWidth = 1.0;                    //Assignment to readonly property

pieChart.borderLineStyle = self.myLineStyle;

The goal is to be able to adjust the spacing between slices of the pie and change their color.

I had found this link when looking for how to do this : http://code.google.com/p/core-plot/issues/detail?id=193

Unfortunately there is not much there but that it can be done using the borderLineStyle property.

Thanks in advance for any help, chances are I am overlooking something silly.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-05T16:46:54+00:00Added an answer on June 5, 2026 at 4:46 pm

    CPTLineStyle is immutable; use a mutable line style instead:

    CPTMutableLineStyle *myLineStyle = [CPTMutableLineStyle lineStyle];
    myLineStyle.lineColor = [CPTColor whiteColor];
    myLineStyle.lineWidth = 1.0;
    
    pieChart.borderLineStyle = myLineStyle;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am getting the invalid assignment error when trying to parse two strings and
i am getting an error: invalid lvalue in assignment. this is the only error
I am overloading the assignment operator, and am getting this error. Cannot solve it.
I am getting a very strange error in my code. This assignment is for
I am getting error trying to run my asp code for executing stored proc.
I'm getting the error uninitialized constant Assignment::AssignmentsCourse. Here are my models: assignment.rb class Assignment
I am busy with an assignment an I am getting an error from the
I'm getting an error when trying to activate a webpart. It activates fine in
I'm getting a strange error when assigning a value to one of my objects.
I am getting this error while trying to retrieve a user profile: An error

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.